Skip to content
v2.278.0

CfnParameterProps Struct ​

Example ​

ts
const stack = new Stack();
const durToken = new CfnParameter(stack, 'MyParameter', {
  type: 'Number',
  default: 60,
});
new CustomResource(stack, 'MyCustomResource', {
  serviceToken: 'MyServiceToken',
  serviceTimeout: Duration.seconds(durToken.valueAsNumber),
});
python
stack = Stack()
dur_token = CfnParameter(stack, "MyParameter",
    type="Number",
    default=60
)
CustomResource(stack, "MyCustomResource",
    service_token="MyServiceToken",
    service_timeout=Duration.seconds(dur_token.value_as_number)
)
java
Stack stack = new Stack();
CfnParameter durToken = CfnParameter.Builder.create(stack, "MyParameter")
        .type("Number")
        .default(60)
        .build();
CustomResource.Builder.create(stack, "MyCustomResource")
        .serviceToken("MyServiceToken")
        .serviceTimeout(Duration.seconds(durToken.getValueAsNumber()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var stack = new Stack();
var durToken = new CfnParameter(stack, "MyParameter", new CfnParameterProps {
    Type = "Number",
    Default = 60
});
new CustomResource(stack, "MyCustomResource", new CustomResourceProps {
    ServiceToken = "MyServiceToken",
    ServiceTimeout = Duration.Seconds(durToken.ValueAsNumber)
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
stack := awscdk.Newstack()
durToken := awscdk.NewCfnParameter(stack, jsii.String("MyParameter"), &CfnParameterProps{
	Type: jsii.String("Number"),
	Default: jsii.Number(60),
})
awscdk.NewCustomResource(stack, jsii.String("MyCustomResource"), &CustomResourceProps{
	ServiceToken: jsii.String("MyServiceToken"),
	ServiceTimeout: awscdk.Duration_Seconds(durToken.valueAsNumber),
})

Properties ​

allowedPatternoptionalstringallowed_patternoptionalstrallowedPatternoptionalStringAllowedPatternoptionalstringAllowedPatternoptional*string #
A regular expression that represents the patterns to allow for String types.

Default: No constraints on patterns allowed for parameter.

allowedValuesoptionalstring[]allowed_valuesoptionaltyping.List[str]allowedValuesoptionalList<String>AllowedValuesoptionalstring[]AllowedValuesoptional*[]*string #
An array containing the list of values allowed for the parameter.

Default: No constraints on values allowed for parameter.

constraintDescriptionoptionalstringconstraint_descriptionoptionalstrconstraintDescriptionoptionalStringConstraintDescriptionoptionalstringConstraintDescriptionoptional*string #
A string that explains a constraint when the constraint is violated.

Default: No description with customized error message when user specifies invalid values.

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:

defaultoptionalanydefaultoptionalAnydefaultoptionalObjectDefaultoptionalobjectDefaultoptionalinterface{} #
A value of the appropriate type for the template to use if no value is specified when a stack is created.

Default: No default value for parameter.

If you define constraints for the parameter, you must specify a value that adheres to those constraints.

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
A string of up to 4000 characters that describes the parameter.

Default: No description for the parameter.

maxLengthoptionalnumbermax_lengthoptionalint | floatmaxLengthoptionalNumberMaxLengthoptionaldoubleMaxLengthoptional*float64 = None. #
An integer value that determines the largest number of characters you want to allow for String types.
maxValueoptionalnumbermax_valueoptionalint | floatmaxValueoptionalNumberMaxValueoptionaldoubleMaxValueoptional*float64 = None. #
A numeric value that determines the largest numeric value you want to allow for Number types.
minLengthoptionalnumbermin_lengthoptionalint | floatminLengthoptionalNumberMinLengthoptionaldoubleMinLengthoptional*float64 = None. #
An integer value that determines the smallest number of characters you want to allow for String types.
minValueoptionalnumbermin_valueoptionalint | floatminValueoptionalNumberMinValueoptionaldoubleMinValueoptional*float64 = None. #
A numeric value that determines the smallest numeric value you want to allow for Number types.
noEchooptionalbooleanno_echooptionalboolnoEchooptionalBooleanNoEchooptionalboolNoEchooptional*bool #
Whether to mask the parameter value when anyone makes a call that describes the stack.

Default: Parameter values are not masked.

If you set the value to true, the parameter value is masked with asterisks (*****).

typeoptionalstringtypeoptionalstrtypeoptionalStringTypeoptionalstringTypeoptional*string = String #
The data type for the parameter (DataType).