CfnStack L1 construct
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html.
| CloudFormation | AWS::OpsWorks::Stack |
|---|---|
| Source | |
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_opsworks as opsworks } from 'aws-cdk-lib';
declare const customJson: any;
const cfnStack = new opsworks.CfnStack(this, 'MyCfnStack', {
defaultInstanceProfileArn: 'defaultInstanceProfileArn',
name: 'name',
serviceRoleArn: 'serviceRoleArn',
// the properties below are optional
agentVersion: 'agentVersion',
attributes: {
attributesKey: 'attributes',
},
chefConfiguration: {
berkshelfVersion: 'berkshelfVersion',
manageBerkshelf: false,
},
cloneAppIds: ['cloneAppIds'],
clonePermissions: false,
configurationManager: {
name: 'name',
version: 'version',
},
customCookbooksSource: {
password: 'password',
revision: 'revision',
sshKey: 'sshKey',
type: 'type',
url: 'url',
username: 'username',
},
customJson: customJson,
defaultAvailabilityZone: 'defaultAvailabilityZone',
defaultOs: 'defaultOs',
defaultRootDeviceType: 'defaultRootDeviceType',
defaultSshKeyName: 'defaultSshKeyName',
defaultSubnetId: 'defaultSubnetId',
ecsClusterArn: 'ecsClusterArn',
elasticIps: [{
ip: 'ip',
// the properties below are optional
name: 'name',
}],
hostnameTheme: 'hostnameTheme',
rdsDbInstances: [{
dbPassword: 'dbPassword',
dbUser: 'dbUser',
rdsDbInstanceArn: 'rdsDbInstanceArn',
}],
sourceStackId: 'sourceStackId',
tags: [{
key: 'key',
value: 'value',
}],
useCustomCookbooks: false,
useOpsworksSecurityGroups: false,
vpcId: 'vpcId',
});
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_opsworks as opsworks
# custom_json: Any
cfn_stack = opsworks.CfnStack(self, "MyCfnStack",
default_instance_profile_arn="defaultInstanceProfileArn",
name="name",
service_role_arn="serviceRoleArn",
# the properties below are optional
agent_version="agentVersion",
attributes={
"attributes_key": "attributes"
},
chef_configuration=opsworks.CfnStack.ChefConfigurationProperty(
berkshelf_version="berkshelfVersion",
manage_berkshelf=False
),
clone_app_ids=["cloneAppIds"],
clone_permissions=False,
configuration_manager=opsworks.CfnStack.StackConfigurationManagerProperty(
name="name",
version="version"
),
custom_cookbooks_source=opsworks.CfnStack.SourceProperty(
password="password",
revision="revision",
ssh_key="sshKey",
type="type",
url="url",
username="username"
),
custom_json=custom_json,
default_availability_zone="defaultAvailabilityZone",
default_os="defaultOs",
default_root_device_type="defaultRootDeviceType",
default_ssh_key_name="defaultSshKeyName",
default_subnet_id="defaultSubnetId",
ecs_cluster_arn="ecsClusterArn",
elastic_ips=[opsworks.CfnStack.ElasticIpProperty(
ip="ip",
# the properties below are optional
name="name"
)],
hostname_theme="hostnameTheme",
rds_db_instances=[opsworks.CfnStack.RdsDbInstanceProperty(
db_password="dbPassword",
db_user="dbUser",
rds_db_instance_arn="rdsDbInstanceArn"
)],
source_stack_id="sourceStackId",
tags=[CfnTag(
key="key",
value="value"
)],
use_custom_cookbooks=False,
use_opsworks_security_groups=False,
vpc_id="vpcId"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.opsworks.*;
Object customJson;
CfnStack cfnStack = CfnStack.Builder.create(this, "MyCfnStack")
.defaultInstanceProfileArn("defaultInstanceProfileArn")
.name("name")
.serviceRoleArn("serviceRoleArn")
// the properties below are optional
.agentVersion("agentVersion")
.attributes(Map.of(
"attributesKey", "attributes"))
.chefConfiguration(ChefConfigurationProperty.builder()
.berkshelfVersion("berkshelfVersion")
.manageBerkshelf(false)
.build())
.cloneAppIds(List.of("cloneAppIds"))
.clonePermissions(false)
.configurationManager(StackConfigurationManagerProperty.builder()
.name("name")
.version("version")
.build())
.customCookbooksSource(SourceProperty.builder()
.password("password")
.revision("revision")
.sshKey("sshKey")
.type("type")
.url("url")
.username("username")
.build())
.customJson(customJson)
.defaultAvailabilityZone("defaultAvailabilityZone")
.defaultOs("defaultOs")
.defaultRootDeviceType("defaultRootDeviceType")
.defaultSshKeyName("defaultSshKeyName")
.defaultSubnetId("defaultSubnetId")
.ecsClusterArn("ecsClusterArn")
.elasticIps(List.of(ElasticIpProperty.builder()
.ip("ip")
// the properties below are optional
.name("name")
.build()))
.hostnameTheme("hostnameTheme")
.rdsDbInstances(List.of(RdsDbInstanceProperty.builder()
.dbPassword("dbPassword")
.dbUser("dbUser")
.rdsDbInstanceArn("rdsDbInstanceArn")
.build()))
.sourceStackId("sourceStackId")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.useCustomCookbooks(false)
.useOpsworksSecurityGroups(false)
.vpcId("vpcId")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.OpsWorks;
var customJson;
var cfnStack = new CfnStack(this, "MyCfnStack", new CfnStackProps {
DefaultInstanceProfileArn = "defaultInstanceProfileArn",
Name = "name",
ServiceRoleArn = "serviceRoleArn",
// the properties below are optional
AgentVersion = "agentVersion",
Attributes = new Dictionary<string, string> {
{ "attributesKey", "attributes" }
},
ChefConfiguration = new ChefConfigurationProperty {
BerkshelfVersion = "berkshelfVersion",
ManageBerkshelf = false
},
CloneAppIds = new [] { "cloneAppIds" },
ClonePermissions = false,
ConfigurationManager = new StackConfigurationManagerProperty {
Name = "name",
Version = "version"
},
CustomCookbooksSource = new SourceProperty {
Password = "password",
Revision = "revision",
SshKey = "sshKey",
Type = "type",
Url = "url",
Username = "username"
},
CustomJson = customJson,
DefaultAvailabilityZone = "defaultAvailabilityZone",
DefaultOs = "defaultOs",
DefaultRootDeviceType = "defaultRootDeviceType",
DefaultSshKeyName = "defaultSshKeyName",
DefaultSubnetId = "defaultSubnetId",
EcsClusterArn = "ecsClusterArn",
ElasticIps = new [] { new ElasticIpProperty {
Ip = "ip",
// the properties below are optional
Name = "name"
} },
HostnameTheme = "hostnameTheme",
RdsDbInstances = new [] { new RdsDbInstanceProperty {
DbPassword = "dbPassword",
DbUser = "dbUser",
RdsDbInstanceArn = "rdsDbInstanceArn"
} },
SourceStackId = "sourceStackId",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
UseCustomCookbooks = false,
UseOpsworksSecurityGroups = false,
VpcId = "vpcId"
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var customJson interface{}
cfnStack := awscdk.Aws_opsworks.NewCfnStack(this, jsii.String("MyCfnStack"), &CfnStackProps{
DefaultInstanceProfileArn: jsii.String("defaultInstanceProfileArn"),
Name: jsii.String("name"),
ServiceRoleArn: jsii.String("serviceRoleArn"),
// the properties below are optional
AgentVersion: jsii.String("agentVersion"),
Attributes: map[string]*string{
"attributesKey": jsii.String("attributes"),
},
ChefConfiguration: &ChefConfigurationProperty{
BerkshelfVersion: jsii.String("berkshelfVersion"),
ManageBerkshelf: jsii.Boolean(false),
},
CloneAppIds: []*string{
jsii.String("cloneAppIds"),
},
ClonePermissions: jsii.Boolean(false),
ConfigurationManager: &StackConfigurationManagerProperty{
Name: jsii.String("name"),
Version: jsii.String("version"),
},
CustomCookbooksSource: &SourceProperty{
Password: jsii.String("password"),
Revision: jsii.String("revision"),
SshKey: jsii.String("sshKey"),
Type: jsii.String("type"),
Url: jsii.String("url"),
Username: jsii.String("username"),
},
CustomJson: customJson,
DefaultAvailabilityZone: jsii.String("defaultAvailabilityZone"),
DefaultOs: jsii.String("defaultOs"),
DefaultRootDeviceType: jsii.String("defaultRootDeviceType"),
DefaultSshKeyName: jsii.String("defaultSshKeyName"),
DefaultSubnetId: jsii.String("defaultSubnetId"),
EcsClusterArn: jsii.String("ecsClusterArn"),
ElasticIps: []interface{}{
&ElasticIpProperty{
Ip: jsii.String("ip"),
// the properties below are optional
Name: jsii.String("name"),
},
},
HostnameTheme: jsii.String("hostnameTheme"),
RdsDbInstances: []interface{}{
&RdsDbInstanceProperty{
DbPassword: jsii.String("dbPassword"),
DbUser: jsii.String("dbUser"),
RdsDbInstanceArn: jsii.String("rdsDbInstanceArn"),
},
},
SourceStackId: jsii.String("sourceStackId"),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
UseCustomCookbooks: jsii.Boolean(false),
UseOpsworksSecurityGroups: jsii.Boolean(false),
VpcId: jsii.String("vpcId"),
})
Initializer
new CfnStack(scope: Construct, id: string, props: CfnStackProps)
CfnStack(scope: Construct, id: str, props: CfnStackProps)
new CfnStack(Construct scope, String id, CfnStackProps props)
new CfnStack(Construct scope, string id, CfnStackProps props)
NewCfnStack(Scope Construct, Id *string, Props CfnStackProps)
Construct Props
agentVersionoptionalstringagent_versionoptionalstragentVersionoptionalStringAgentVersionoptionalstringAgentVersionoptional*string #notes
- Auto-update - Set this parameter to
LATEST. OpsWorks Stacks automatically installs new agent versions on the stack's instances as soon as they are available. - Fixed version - Set this parameter to your preferred agent version. To update the agent version, you must edit the stack configuration and specify a new version. OpsWorks Stacks installs that version on the stack's instances.
The default setting is the most recent release of the agent. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call DescribeAgentVersions . AgentVersion cannot be set to Chef 12.2.
You can also specify an agent version when you create or update an instance, which overrides the stack's default setting.
attributesoptionalIResolvable | { [key: string]: string }attributesoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]attributesoptionalIResolvableAttributesoptionalIResolvableAttributesoptionalinterface{} #chefConfigurationoptionalIResolvable | CfnStack.chef_configurationoptionaltyping.Union[IResolvable, ChefConfigurationProperty]chefConfigurationoptionalIResolvableChefConfigurationoptionalIResolvableChefConfigurationoptionalinterface{} #cloneAppIdsoptionalstring[]clone_app_idsoptionaltyping.List[str]cloneAppIdsoptionalList<String>CloneAppIdsoptionalstring[]CloneAppIdsoptional*[]*string #clonePermissionsoptionalboolean | IResolvableclone_permissionsoptionaltyping.Union[bool, IResolvable]clonePermissionsoptionalBooleanClonePermissionsoptionalboolClonePermissionsoptionalinterface{} #configurationManageroptionalIResolvable | CfnStack.configuration_manageroptionaltyping.Union[IResolvable, StackConfigurationManagerProperty]configurationManageroptionalIResolvableConfigurationManageroptionalIResolvableConfigurationManageroptionalinterface{} #When you create a stack we recommend that you use the configuration manager to specify the Chef version: 12, 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default value for Linux stacks is currently 12.
customCookbooksSourceoptionalIResolvable | CfnStack.SourcePropertycustom_cookbooks_sourceoptionaltyping.Union[IResolvable, SourceProperty]customCookbooksSourceoptionalIResolvableCustomCookbooksSourceoptionalIResolvableCustomCookbooksSourceoptionalinterface{} #For more information, see Adding Apps or Cookbooks and Recipes .
customJsonoptionalanycustom_jsonoptionalAnycustomJsonoptionalObjectCustomJsonoptionalobjectCustomJsonoptionalinterface{} #notes
It can be used to override the corresponding default stack configuration attribute values or to pass data to recipes. The string should be in the following format:
"{\"key1\": \"value1\", \"key2\": \"value2\",...}"
For more information about custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes .
defaultAvailabilityZoneoptionalstringdefault_availability_zoneoptionalstrdefaultAvailabilityZoneoptionalStringDefaultAvailabilityZoneoptionalstringDefaultAvailabilityZoneoptional*string #notes
For more information, see Regions and Endpoints . If you also specify a value for DefaultSubnetId , the subnet must be in the same zone. For more information, see the VpcId parameter description.
defaultInstanceProfileArnstringdefault_instance_profile_arnstrdefaultInstanceProfileArnStringDefaultInstanceProfileArnstringDefaultInstanceProfileArn*string required #For more information about IAM ARNs, see Using Identifiers .
defaultOsoptionalstringdefault_osoptionalstrdefaultOsoptionalStringDefaultOsoptionalstringDefaultOsoptional*string #notes
You can specify one of the following.
- A supported Linux operating system: An Amazon Linux version, such as
Amazon Linux 2,Amazon Linux 2018.03,Amazon Linux 2017.09,Amazon Linux 2017.03,Amazon Linux 2016.09,Amazon Linux 2016.03,Amazon Linux 2015.09, orAmazon Linux 2015.03. - A supported Ubuntu operating system, such as
Ubuntu 18.04 LTS,Ubuntu 16.04 LTS,Ubuntu 14.04 LTS, orUbuntu 12.04 LTS. CentOS Linux 7Red Hat Enterprise Linux 7- A supported Windows operating system, such as
Microsoft Windows Server 2012 R2 Base,Microsoft Windows Server 2012 R2 with SQL Server Express,Microsoft Windows Server 2012 R2 with SQL Server Standard, orMicrosoft Windows Server 2012 R2 with SQL Server Web. - A custom AMI:
Custom. You specify the custom AMI you want to use when you create instances. For more information, see Using Custom AMIs .
The default option is the current Amazon Linux version. Not all operating systems are supported with all versions of Chef. For more information about supported operating systems, see OpsWorks Stacks Operating Systems .
defaultRootDeviceTypeoptionalstringdefault_root_device_typeoptionalstrdefaultRootDeviceTypeoptionalStringDefaultRootDeviceTypeoptionalstringDefaultRootDeviceTypeoptional*string #notes
This value is the default for all instances in the stack, but you can override it when you create an instance. The default option is instance-store . For more information, see Storage for the Root Device .
defaultSshKeyNameoptionalstringdefault_ssh_key_nameoptionalstrdefaultSshKeyNameoptionalStringDefaultSshKeyNameoptionalstringDefaultSshKeyNameoptional*string #notes
The default value is none. If you specify a key pair name, OpsWorks installs the public key on the instance and you can use the private key with an SSH client to log in to the instance. For more information, see Using SSH to Communicate with an Instance and Managing SSH Access . You can override this setting by specifying a different key pair, or no key pair, when you create an instance .
defaultSubnetIdoptionalstringdefault_subnet_idoptionalstrdefaultSubnetIdoptionalStringDefaultSubnetIdoptionalstringDefaultSubnetIdoptional*string #notes
All instances are launched into this subnet unless you specify another subnet ID when you create the instance. This parameter is required if you specify a value for the VpcId parameter. If you also specify a value for DefaultAvailabilityZone , the subnet must be in that zone.
ecsClusterArnoptionalstringecs_cluster_arnoptionalstrecsClusterArnoptionalStringEcsClusterArnoptionalstringEcsClusterArnoptional*string #If you specify a cluster that's registered with another OpsWorks stack, CloudFormation deregisters the existing association before registering the cluster.
elasticIpsoptionalIResolvable | IResolvable | CfnStack.ElasticIpProperty[]elastic_ipsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ElasticIpProperty]]]elasticIpsoptionalIResolvableElasticIpsoptionalIResolvableElasticIpsoptionalinterface{} #If you specify an IP address that's registered with another OpsWorks stack, CloudFormation deregisters the existing association before registering the IP address.
hostnameThemeoptionalstringhostname_themeoptionalstrhostnameThemeoptionalStringHostnameThemeoptionalstringHostnameThemeoptional*string #notes
The theme is used to generate host names for the stack's instances. By default, HostnameTheme is set to Layer_Dependent , which creates host names by appending integers to the layer's short name. The other themes are:
Baked_GoodsCloudsEurope_CitiesFruitsGreek_Deities_and_TitansLegendary_creatures_from_JapanPlanets_and_MoonsRoman_DeitiesScottish_IslandsUS_CitiesWild_Cats
To obtain a generated host name, call GetHostNameSuggestion , which returns a host name based on the current theme.
Stack names can be a maximum of 64 characters.
rdsDbInstancesoptionalIResolvable | IResolvable | CfnStack.RdsDbInstanceProperty[]rds_db_instancesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, RdsDbInstanceProperty]]]rdsDbInstancesoptionalIResolvableRdsDbInstancesoptionalIResolvableRdsDbInstancesoptionalinterface{} #If you specify a database instance that's registered with another OpsWorks stack, CloudFormation deregisters the existing association before registering the database instance.
serviceRoleArnstringservice_role_arnstrserviceRoleArnStringServiceRoleArnstringServiceRoleArn*string required #You must set this parameter to the Amazon Resource Name (ARN) for an existing IAM role. For more information about IAM ARNs, see Using Identifiers .
sourceStackIdoptionalstringsource_stack_idoptionalstrsourceStackIdoptionalStringSourceStackIdoptionalstringSourceStackIdoptional*string #tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #notes
- The key cannot be empty.
- The key can be a maximum of 127 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters:
+ - = . _ : / - The value can be a maximum 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters:
+ - = . _ : / - Leading and trailing white spaces are trimmed from both the key and value.
- A maximum of 40 tags is allowed for any resource.
useCustomCookbooksoptionalboolean | IResolvableuse_custom_cookbooksoptionaltyping.Union[bool, IResolvable]useCustomCookbooksoptionalBooleanUseCustomCookbooksoptionalboolUseCustomCookbooksoptionalinterface{} #useOpsworksSecurityGroupsoptionalboolean | IResolvableuse_opsworks_security_groupsoptionaltyping.Union[bool, IResolvable]useOpsworksSecurityGroupsoptionalBooleanUseOpsworksSecurityGroupsoptionalboolUseOpsworksSecurityGroupsoptionalinterface{} #notes
OpsWorks Stacks provides a standard set of built-in security groups, one for each layer, which are associated with layers by default. With UseOpsworksSecurityGroups you can instead provide your own custom security groups. UseOpsworksSecurityGroups has the following settings:
- True - OpsWorks Stacks automatically associates the appropriate built-in security group with each layer (default setting). You can associate additional security groups with a layer after you create it, but you cannot delete the built-in security group.
- False - OpsWorks Stacks does not associate built-in security groups with layers. You must create appropriate EC2 security groups and associate a security group with each layer that you create. However, you can still manually associate a built-in security group with a layer on creation; custom security groups are required only for those layers that need custom settings.
For more information, see Create a New Stack .
notes
The VPC must be in the stack's region. All instances are launched into this VPC. You cannot change the ID later.
- If your account supports EC2-Classic, the default value is
no VPC. - If your account does not support EC2-Classic, the default value is the default VPC for the specified region.
If the VPC ID corresponds to a default VPC and you have specified either the DefaultAvailabilityZone or the DefaultSubnetId parameter only, OpsWorks Stacks infers the value of the other parameter. If you specify neither parameter, OpsWorks Stacks sets these parameters to the first valid Availability Zone for the specified region and the corresponding default VPC subnet ID, respectively.
If you specify a nondefault VPC ID, note the following:
- It must belong to a VPC in your account that is in the specified region.
- You must specify a value for
DefaultSubnetId.
For more information about how to use OpsWorks Stacks with a VPC, see Running a Stack in a VPC . For more information about default VPC and EC2-Classic, see Supported Platforms .
Properties
agentVersionmay be undefinedstringagent_versionmay be undefinedstragentVersionmay be undefinedStringAgentVersionmay be undefinedstringAgentVersionmay be undefined*string #You have the following options:.
attributesmay be undefinedIResolvable | { [key: string]: string }attributesmay be undefinedtyping.Union[IResolvable, typing.Mapping[str, str]]attributesmay be undefinedIResolvableAttributesmay be undefinedIResolvableAttributesmay be undefinedinterface{} #CFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAMEstrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*string static #cfnOptionsICfnResourceOptionscfn_optionsICfnResourceOptionscfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptions #cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*string #chefConfigurationmay be undefinedIResolvable | CfnStack.chef_configurationmay be undefinedtyping.Union[IResolvable, ChefConfigurationProperty]chefConfigurationmay be undefinedIResolvableChefConfigurationmay be undefinedIResolvableChefConfigurationmay be undefinedinterface{} #cloneAppIdsmay be undefinedstring[]clone_app_idsmay be undefinedtyping.List[str]cloneAppIdsmay be undefinedList<String>CloneAppIdsmay be undefinedstring[]CloneAppIdsmay be undefined*[]*string #clonePermissionsmay be undefinedboolean | IResolvableclone_permissionsmay be undefinedtyping.Union[bool, IResolvable]clonePermissionsmay be undefinedBooleanClonePermissionsmay be undefinedboolClonePermissionsmay be undefinedinterface{} #configurationManagermay be undefinedIResolvable | CfnStack.configuration_managermay be undefinedtyping.Union[IResolvable, StackConfigurationManagerProperty]configurationManagermay be undefinedIResolvableConfigurationManagermay be undefinedIResolvableConfigurationManagermay be undefinedinterface{} #creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*string #customCookbooksSourcemay be undefinedIResolvable | CfnStack.SourcePropertycustom_cookbooks_sourcemay be undefinedtyping.Union[IResolvable, SourceProperty]customCookbooksSourcemay be undefinedIResolvableCustomCookbooksSourcemay be undefinedIResolvableCustomCookbooksSourcemay be undefinedinterface{} #defaultAvailabilityZonemay be undefinedstringdefault_availability_zonemay be undefinedstrdefaultAvailabilityZonemay be undefinedStringDefaultAvailabilityZonemay be undefinedstringDefaultAvailabilityZonemay be undefined*string #defaultInstanceProfileArnstringdefault_instance_profile_arnstrdefaultInstanceProfileArnStringDefaultInstanceProfileArnstringDefaultInstanceProfileArn*string #defaultOsmay be undefinedstringdefault_osmay be undefinedstrdefaultOsmay be undefinedStringDefaultOsmay be undefinedstringDefaultOsmay be undefined*string #defaultRootDeviceTypemay be undefinedstringdefault_root_device_typemay be undefinedstrdefaultRootDeviceTypemay be undefinedStringDefaultRootDeviceTypemay be undefinedstringDefaultRootDeviceTypemay be undefined*string #defaultSshKeyNamemay be undefinedstringdefault_ssh_key_namemay be undefinedstrdefaultSshKeyNamemay be undefinedStringDefaultSshKeyNamemay be undefinedstringDefaultSshKeyNamemay be undefined*string #defaultSubnetIdmay be undefinedstringdefault_subnet_idmay be undefinedstrdefaultSubnetIdmay be undefinedStringDefaultSubnetIdmay be undefinedstringDefaultSubnetIdmay be undefined*string #ecsClusterArnmay be undefinedstringecs_cluster_arnmay be undefinedstrecsClusterArnmay be undefinedStringEcsClusterArnmay be undefinedstringEcsClusterArnmay be undefined*string #elasticIpsmay be undefinedIResolvable | IResolvable | CfnStack.ElasticIpProperty[]elastic_ipsmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ElasticIpProperty]]]elasticIpsmay be undefinedIResolvableElasticIpsmay be undefinedIResolvableElasticIpsmay be undefinedinterface{} #hostnameThememay be undefinedstringhostname_thememay be undefinedstrhostnameThememay be undefinedStringHostnameThememay be undefinedstringHostnameThememay be undefined*string #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).
rdsDbInstancesmay be undefinedIResolvable | IResolvable | CfnStack.RdsDbInstanceProperty[]rds_db_instancesmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, RdsDbInstanceProperty]]]rdsDbInstancesmay be undefinedIResolvableRdsDbInstancesmay be undefinedIResolvableRdsDbInstancesmay be undefinedinterface{} #If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).
serviceRoleArnstringservice_role_arnstrserviceRoleArnStringServiceRoleArnstringServiceRoleArn*string #sourceStackIdmay be undefinedstringsource_stack_idmay be undefinedstrsourceStackIdmay be undefinedStringSourceStackIdmay be undefinedstringSourceStackIdmay be undefined*string #CfnElements must be defined within a stack scope (directly or indirectly).
stackRefStackReferencestack_refStackReferencestackRefStackReferenceStackRefStackReferenceStackRefStackReference #tagsRawmay be undefinedCfnTag[]tags_rawmay be undefinedtyping.List[CfnTag]tagsRawmay be undefinedList<CfnTag>TagsRawmay be undefinedCfnTag[]TagsRawmay be undefined*[]CfnTag #useCustomCookbooksmay be undefinedboolean | IResolvableuse_custom_cookbooksmay be undefinedtyping.Union[bool, IResolvable]useCustomCookbooksmay be undefinedBooleanUseCustomCookbooksmay be undefinedboolUseCustomCookbooksmay be undefinedinterface{} #useOpsworksSecurityGroupsmay be undefinedboolean | IResolvableuse_opsworks_security_groupsmay be undefinedtyping.Union[bool, IResolvable]useOpsworksSecurityGroupsmay be undefinedBooleanUseOpsworksSecurityGroupsmay be undefinedboolUseOpsworksSecurityGroupsmay be undefinedinterface{} #vpcIdmay be undefinedstringvpc_idmay be undefinedstrvpcIdmay be undefinedStringVpcIdmay be undefinedstringVpcIdmay be undefined*string #Methods
addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string) #1 parameter
Parameters
pathpathpathpathPath— The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource) deprecated #This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.
addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource) deprecated #notes
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.
addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{}) #addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{}) #notes · 2 parameters
To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).
If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.
For example,
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
would add the overrides
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.
Parameters
pathpathpathpathPath— - The path of the property, you can use dot notation to override values in complex types.valuevaluevaluevalueValue— - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string) #1 parameter
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{}) #Syntactic sugar for addOverride("Properties.<...>", value).
2 parameters
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path of the property.valuevaluevaluevalueValue— The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string) #notes
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength) #When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.
1 parameter
Parameters
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions) #notes
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:
cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string #getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference #Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.
1 parameter
Parameters
attributeNameattribute_nameattributeNameattributeNameAttributeName— The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{} #inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector) #1 parameter
Parameters
inspectorinspectorinspectorinspectorInspector— tree inspector to collect and process attributes.
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{}) *bool static #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.
isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *bool static #isCfnStack(x: any): boolean@staticmethod def is_cfn_stack(x: Any) -> boolpublic static Boolean isCfnStack(Object x)public static bool IsCfnStack(object x)func IsCfnStack(X interface{}) *bool static #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{}) *bool static #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.
obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{} #For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.
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.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource) deprecated #This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource) #This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource) #2 parameters
Parameters
targettargettargettargetTarget— The dependency to replace.newTargetnew_targetnewTargetnewTargetNewTarget— The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string #returns
Returns: a string representation of this resource
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.