CfnParameter L1 construct
A CloudFormation parameter.
Use the optional Parameters section to customize your templates. Parameters enable you to input custom values to your template each time you create or update a stack.
Example
const myTopic = new sns.Topic(this, 'MyTopic');
const url = new CfnParameter(this, 'url-param');
myTopic.addSubscription(new subscriptions.UrlSubscription(url.valueAsString));
my_topic = sns.Topic(self, "MyTopic")
url = CfnParameter(self, "url-param")
my_topic.add_subscription(subscriptions.UrlSubscription(url.value_as_string))
Topic myTopic = new Topic(this, "MyTopic");
CfnParameter url = new CfnParameter(this, "url-param");
myTopic.addSubscription(new UrlSubscription(url.getValueAsString()));
// Install: dotnet add package Amazon.CDK.Lib
var myTopic = new Topic(this, "MyTopic");
var url = new CfnParameter(this, "url-param");
myTopic.AddSubscription(new UrlSubscription(url.ValueAsString));
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
myTopic := sns.NewTopic(this, jsii.String("MyTopic"))
url := awscdk.NewCfnParameter(this, jsii.String("url-param"))
myTopic.AddSubscription(subscriptions.NewUrlSubscription(url.valueAsString))
Initializer
new CfnParameter(scope: Construct, id: string, props?: CfnParameterProps)
CfnParameter(scope: Construct, id: str, props: typing.Optional[CfnParameterProps] = None)
new CfnParameter(Construct scope, String id, CfnParameterProps props)
new CfnParameter(Construct scope, string id, CfnParameterProps? props = null)
NewCfnParameter(Scope Construct, Id *string, Props CfnParameterProps)
Construct Props
allowedPatternstringallowed_patternstrallowedPatternStringAllowedPatternstringAllowedPattern*string= No constraints on patterns allow…#default
Default: No constraints on patterns allowed for parameter.
allowedValuesstring[]allowed_valuestyping.List[str]allowedValuesList<String>AllowedValuesstring[]AllowedValues*[]*string= No constraints on values allowed…#default
Default: No constraints on values allowed for parameter.
constraintDescriptionstringconstraint_descriptionstrconstraintDescriptionStringConstraintDescriptionstringConstraintDescription*string= No description with customized e…#For example, without a constraint description, a parameter that has an allowed pattern of [A-Za-z0-9]+ displays the following error message when the user specifies an invalid value:
default
Default: No description with customized error message when user specifies invalid values.
If you define constraints for the parameter, you must specify a value that adheres to those constraints.
descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= No description for the parameter…#default
Default: No description for the parameter.
If you set the value to true, the parameter value is masked with asterisks (*****).
Properties
allowedPatternstringallowed_patternstrallowedPatternStringAllowedPatternstringAllowedPattern*string= No constraints on patterns allow…#default
Default: No constraints on patterns allowed for parameter.
allowedValuesstring[]allowed_valuestyping.List[str]allowedValuesList<String>AllowedValuesstring[]AllowedValues*[]*string= No constraints on values allowed…#default
Default: No constraints on values allowed for parameter.
constraintDescriptionstringconstraint_descriptionstrconstraintDescriptionStringConstraintDescriptionstringConstraintDescription*string= No description with customized e…#For example, without a constraint description, a parameter that has an allowed pattern of [A-Za-z0-9]+ displays the following error message when the user specifies an invalid value:
default
Default: No description with customized error message when user specifies invalid values.
creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*stringrequired#defaultanydefaultAnydefaultObjectDefaultobjectDefaultinterface{}= No default value for parameter.required#If you define constraints for the parameter, you must specify a value that adheres to those constraints.
descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= No description for the parameter…#default
Default: No description for the parameter.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use overrideLogicalId(newLogicalId).
CfnElements must be defined within a stack scope (directly or indirectly).
valueAsListstring[]value_as_listtyping.List[str]valueAsListList<String>ValueAsListstring[]ValueAsList*[]*stringrequired#valueAsNumbernumbervalue_as_numberint | floatvalueAsNumberNumberValueAsNumberdoubleValueAsNumber*float64required#valueAsStringstringvalue_as_stringstrvalueAsStringStringValueAsStringstringValueAsString*stringrequired#Methods
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.
returns
Returns: The construct as a stack element or undefined if it is not a stack element.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#1 parameter
Parameters
newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId— The new logical ID to use for this stack element.
resolve(_context: IResolveContext): anydef resolve(self, _context: IResolveContext) -> Anypublic Object resolve(IResolveContext _context)public object Resolve(IResolveContext _context)func Resolve(_context IResolveContext) interface{}#toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.