Show / Hide Table of Contents

Class CfnParameter

A CloudFormation parameter.

Inheritance
object
CfnElement
CfnParameter
Inherited Members
CfnElement.IsCfnElement(object)
CfnElement.OverrideLogicalId(string)
CfnElement.CreationStack
CfnElement.LogicalId
CfnElement.Stack
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnParameter : CfnElement
Syntax (vb)
Public Class CfnParameter Inherits CfnElement
Remarks

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.

ExampleMetadata: infused

Examples
var myTopic = new Topic(this, "MyTopic");
             var url = new CfnParameter(this, "url-param");

             myTopic.AddSubscription(new UrlSubscription(url.ValueAsString));

Synopsis

Constructors

CfnParameter(Construct, string, ICfnParameterProps?)

Creates a parameter construct.

Properties

AllowedPattern

A regular expression that represents the patterns to allow for String types.

AllowedValues

An array containing the list of values allowed for the parameter.

ConstraintDescription

A string that explains a constraint when the constraint is violated.

Default

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

Description

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

MaxLength

An integer value that determines the largest number of characters you want to allow for String types.

MaxValue

A numeric value that determines the largest numeric value you want to allow for Number types.

MinLength

An integer value that determines the smallest number of characters you want to allow for String types.

MinValue

A numeric value that determines the smallest numeric value you want to allow for Number types.

NoEcho

Indicates if this parameter is configured with "NoEcho" enabled.

Type

The data type for the parameter (DataType).

Value

The parameter value as a Token.

ValueAsList

The parameter value, if it represents a string list.

ValueAsNumber

The parameter value, if it represents a number.

ValueAsString

The parameter value, if it represents a string.

Methods

Resolve(IResolveContext)

A CloudFormation parameter.

Constructors

CfnParameter(Construct, string, ICfnParameterProps?)

Creates a parameter construct.

public CfnParameter(Construct scope, string id, ICfnParameterProps? props = null)
Parameters
scope Construct

The parent construct.

id string

The parent construct.

props ICfnParameterProps

The parameter properties.

Remarks

Note that the name (logical ID) of the parameter will derive from it's coname and location within the stack. Therefore, it is recommended that parameters are defined at the stack level.

Properties

AllowedPattern

A regular expression that represents the patterns to allow for String types.

public virtual string? AllowedPattern { get; set; }
Property Value

string

Remarks

Default: - No constraints on patterns allowed for parameter.

AllowedValues

An array containing the list of values allowed for the parameter.

public virtual string[]? AllowedValues { get; set; }
Property Value

string[]

Remarks

Default: - No constraints on values allowed for parameter.

ConstraintDescription

A string that explains a constraint when the constraint is violated.

public virtual string? ConstraintDescription { get; set; }
Property Value

string

Remarks

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: - No description with customized error message when user specifies invalid values.

Default

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

public virtual object Default { get; set; }
Property Value

object

Remarks

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

Default: - No default value for parameter.

Description

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

public virtual string? Description { get; set; }
Property Value

string

Remarks

Default: - No description for the parameter.

MaxLength

An integer value that determines the largest number of characters you want to allow for String types.

public virtual double? MaxLength { get; set; }
Property Value

double?

Remarks

Default: - None.

MaxValue

A numeric value that determines the largest numeric value you want to allow for Number types.

public virtual double? MaxValue { get; set; }
Property Value

double?

Remarks

Default: - None.

MinLength

An integer value that determines the smallest number of characters you want to allow for String types.

public virtual double? MinLength { get; set; }
Property Value

double?

Remarks

Default: - None.

MinValue

A numeric value that determines the smallest numeric value you want to allow for Number types.

public virtual double? MinValue { get; set; }
Property Value

double?

Remarks

Default: - None.

NoEcho

Indicates if this parameter is configured with "NoEcho" enabled.

public virtual bool NoEcho { get; set; }
Property Value

bool

Remarks

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.

ExampleMetadata: infused

Type

The data type for the parameter (DataType).

public virtual string Type { get; set; }
Property Value

string

Remarks

Default: String

Value

The parameter value as a Token.

public virtual IResolvable Value { get; }
Property Value

IResolvable

Remarks

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.

ExampleMetadata: infused

ValueAsList

The parameter value, if it represents a string list.

public virtual string[] ValueAsList { get; }
Property Value

string[]

Remarks

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.

ExampleMetadata: infused

ValueAsNumber

The parameter value, if it represents a number.

public virtual double ValueAsNumber { get; }
Property Value

double

Remarks

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.

ExampleMetadata: infused

ValueAsString

The parameter value, if it represents a string.

public virtual string ValueAsString { get; }
Property Value

string

Remarks

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.

ExampleMetadata: infused

Methods

Resolve(IResolveContext)

A CloudFormation parameter.

public virtual object Resolve(IResolveContext context)
Parameters
context IResolveContext
Returns

object

Remarks

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.

ExampleMetadata: infused

Examples
var myTopic = new Topic(this, "MyTopic");
             var url = new CfnParameter(this, "url-param");

             myTopic.AddSubscription(new UrlSubscription(url.ValueAsString));
Back to top Generated by DocFX