class CfnStack (construct)
This page is available in another version. Click here for the v2 documentation.
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.OpsWorks.CfnStack |
Java | software.amazon.awscdk.services.opsworks.CfnStack |
Python | aws_cdk.aws_opsworks.CfnStack |
TypeScript | @aws-cdk/aws-opsworks » CfnStack |
Implements
IConstruct
, IConstruct
, IDependable
, IInspectable
A CloudFormation AWS::OpsWorks::Stack
.
Creates a new stack. For more information, see Create a New Stack .
Required Permissions : To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information about user permissions, see Managing User Permissions .
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as opsworks from '@aws-cdk/aws-opsworks';
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',
});
Initializer
new CfnStack(scope: Construct, id: string, props: CfnStackProps)
Parameters
- scope
Construct
— - scope in which this resource is defined. - id
string
— - scoped id of the resource. - props
Cfn
— - resource properties.Stack Props
Create a new AWS::OpsWorks::Stack
.
Construct Props
Name | Type | Description |
---|---|---|
default | string | The Amazon Resource Name (ARN) of an IAM profile that is the default profile for all of the stack's EC2 instances. |
name | string | The stack name. |
service | string | The stack's IAM role, which allows AWS OpsWorks Stacks to work with AWS resources on your behalf. |
agent | string | The default AWS OpsWorks Stacks agent version. You have the following options:. |
attributes? | IResolvable | { [string]: string } | One or more user-defined key-value pairs to be added to the stack attributes. |
chef | IResolvable | Chef | A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more information, see Create a New Stack . |
clone | string[] | If you're cloning an AWS OpsWorks stack, a list of AWS OpsWorks application stack IDs from the source stack to include in the cloned stack. |
clone | boolean | IResolvable | If you're cloning an AWS OpsWorks stack, indicates whether to clone the source stack's permissions. |
configuration | IResolvable | Stack | The configuration manager. |
custom | IResolvable | Source | Contains the information required to retrieve an app or cookbook from a repository. |
custom | any | A string that contains user-defined, custom JSON. |
default | string | The stack's default Availability Zone, which must be in the specified region. |
default | string | The stack's default operating system, which is installed on every instance unless you specify a different operating system when you create the instance. |
default | string | The default root device type. |
default | string | A default Amazon EC2 key pair name. |
default | string | The stack's default subnet ID. |
ecs | string | The Amazon Resource Name (ARN) of the Amazon Elastic Container Service ( Amazon ECS ) cluster to register with the AWS OpsWorks stack. |
elastic | IResolvable | IResolvable | Elastic [] | A list of Elastic IP addresses to register with the AWS OpsWorks stack. |
hostname | string | The stack's host name theme, with spaces replaced by underscores. |
rds | IResolvable | IResolvable | Rds [] | The Amazon Relational Database Service ( Amazon RDS ) database instance to register with the AWS OpsWorks stack. |
source | string | If you're cloning an AWS OpsWorks stack, the stack ID of the source AWS OpsWorks stack to clone. |
tags? | Cfn [] | A map that contains tag keys and tag values that are attached to a stack or layer. |
use | boolean | IResolvable | Whether the stack uses custom cookbooks. |
use | boolean | IResolvable | Whether to associate the AWS OpsWorks Stacks built-in security groups with the stack's layers. |
vpc | string | The ID of the VPC that the stack is to be launched into. |
defaultInstanceProfileArn
Type:
string
The Amazon Resource Name (ARN) of an IAM profile that is the default profile for all of the stack's EC2 instances.
For more information about IAM ARNs, see Using Identifiers .
name
Type:
string
The stack name.
Stack names can be a maximum of 64 characters.
serviceRoleArn
Type:
string
The stack's IAM role, which allows AWS OpsWorks Stacks to work with AWS resources on your behalf.
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 .
agentVersion?
Type:
string
(optional)
The default AWS OpsWorks Stacks agent version. You have the following options:.
- Auto-update - Set this parameter to
LATEST
. AWS 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. AWS 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.
attributes?
Type:
IResolvable
| { [string]: string }
(optional)
One or more user-defined key-value pairs to be added to the stack attributes.
chefConfiguration?
Type:
IResolvable
|
Chef
(optional)
A ChefConfiguration
object that specifies whether to enable Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more information, see Create a New Stack .
cloneAppIds?
Type:
string[]
(optional)
If you're cloning an AWS OpsWorks stack, a list of AWS OpsWorks application stack IDs from the source stack to include in the cloned stack.
clonePermissions?
Type:
boolean |
IResolvable
(optional)
If you're cloning an AWS OpsWorks stack, indicates whether to clone the source stack's permissions.
configurationManager?
Type:
IResolvable
|
Stack
(optional)
The configuration manager.
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.
customCookbooksSource?
Type:
IResolvable
|
Source
(optional)
Contains the information required to retrieve an app or cookbook from a repository.
For more information, see Adding Apps or Cookbooks and Recipes .
customJson?
Type:
any
(optional)
A string that contains user-defined, custom JSON.
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 .
defaultAvailabilityZone?
Type:
string
(optional)
The stack's default Availability Zone, which must be in the specified region.
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.
defaultOs?
Type:
string
(optional)
The stack's default operating system, which is installed on every instance unless you specify a different operating system when you create the instance.
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 7
Red 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 AWS OpsWorks Stacks Operating Systems .
defaultRootDeviceType?
Type:
string
(optional)
The default root device type.
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 .
defaultSshKeyName?
Type:
string
(optional)
A default Amazon EC2 key pair name.
The default value is none. If you specify a key pair name, AWS 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 .
defaultSubnetId?
Type:
string
(optional)
The stack's default subnet ID.
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.
ecsClusterArn?
Type:
string
(optional)
The Amazon Resource Name (ARN) of the Amazon Elastic Container Service ( Amazon ECS ) cluster to register with the AWS OpsWorks stack.
If you specify a cluster that's registered with another AWS OpsWorks stack, AWS CloudFormation deregisters the existing association before registering the cluster.
elasticIps?
Type:
IResolvable
|
IResolvable
|
Elastic
[]
(optional)
A list of Elastic IP addresses to register with the AWS OpsWorks stack.
If you specify an IP address that's registered with another AWS OpsWorks stack, AWS CloudFormation deregisters the existing association before registering the IP address.
hostnameTheme?
Type:
string
(optional)
The stack's host name theme, with spaces replaced by underscores.
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_Goods
Clouds
Europe_Cities
Fruits
Greek_Deities_and_Titans
Legendary_creatures_from_Japan
Planets_and_Moons
Roman_Deities
Scottish_Islands
US_Cities
Wild_Cats
To obtain a generated host name, call GetHostNameSuggestion
, which returns a host name based on the current theme.
rdsDbInstances?
Type:
IResolvable
|
IResolvable
|
Rds
[]
(optional)
The Amazon Relational Database Service ( Amazon RDS ) database instance to register with the AWS OpsWorks stack.
If you specify a database instance that's registered with another AWS OpsWorks stack, AWS CloudFormation deregisters the existing association before registering the database instance.
sourceStackId?
Type:
string
(optional)
If you're cloning an AWS OpsWorks stack, the stack ID of the source AWS OpsWorks stack to clone.
tags?
Type:
Cfn
[]
(optional)
A map that contains tag keys and tag values that are attached to a stack or layer.
- 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.
useCustomCookbooks?
Type:
boolean |
IResolvable
(optional)
Whether the stack uses custom cookbooks.
useOpsworksSecurityGroups?
Type:
boolean |
IResolvable
(optional)
Whether to associate the AWS OpsWorks Stacks built-in security groups with the stack's layers.
AWS 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 - AWS 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 - AWS 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 .
vpcId?
Type:
string
(optional)
The ID of the VPC that the stack is to be launched into.
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, AWS OpsWorks Stacks infers the value of the other parameter. If you specify neither parameter, AWS 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 AWS 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
Name | Type | Description |
---|---|---|
cfn | ICfn | Options for this resource, such as condition, update policy etc. |
cfn | { [string]: any } | |
cfn | string | AWS resource type. |
creation | string[] | |
custom | any | A string that contains user-defined, custom JSON. |
default | string | The Amazon Resource Name (ARN) of an IAM profile that is the default profile for all of the stack's EC2 instances. |
logical | string | The logical ID for this CloudFormation stack element. |
name | string | The stack name. |
node | Construct | The construct tree node associated with this construct. |
ref | string | Return a string that will be resolved to a CloudFormation { Ref } for this element. |
service | string | The stack's IAM role, which allows AWS OpsWorks Stacks to work with AWS resources on your behalf. |
stack | Stack | The stack in which this element is defined. |
tags | Tag | A map that contains tag keys and tag values that are attached to a stack or layer. |
agent | string | The default AWS OpsWorks Stacks agent version. You have the following options:. |
attributes? | IResolvable | { [string]: string } | One or more user-defined key-value pairs to be added to the stack attributes. |
chef | IResolvable | Chef | A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more information, see Create a New Stack . |
clone | string[] | If you're cloning an AWS OpsWorks stack, a list of AWS OpsWorks application stack IDs from the source stack to include in the cloned stack. |
clone | boolean | IResolvable | If you're cloning an AWS OpsWorks stack, indicates whether to clone the source stack's permissions. |
configuration | IResolvable | Stack | The configuration manager. |
custom | IResolvable | Source | Contains the information required to retrieve an app or cookbook from a repository. |
default | string | The stack's default Availability Zone, which must be in the specified region. |
default | string | The stack's default operating system, which is installed on every instance unless you specify a different operating system when you create the instance. |
default | string | The default root device type. |
default | string | A default Amazon EC2 key pair name. |
default | string | The stack's default subnet ID. |
ecs | string | The Amazon Resource Name (ARN) of the Amazon Elastic Container Service ( Amazon ECS ) cluster to register with the AWS OpsWorks stack. |
elastic | IResolvable | IResolvable | Elastic [] | A list of Elastic IP addresses to register with the AWS OpsWorks stack. |
hostname | string | The stack's host name theme, with spaces replaced by underscores. |
rds | IResolvable | IResolvable | Rds [] | The Amazon Relational Database Service ( Amazon RDS ) database instance to register with the AWS OpsWorks stack. |
source | string | If you're cloning an AWS OpsWorks stack, the stack ID of the source AWS OpsWorks stack to clone. |
use | boolean | IResolvable | Whether the stack uses custom cookbooks. |
use | boolean | IResolvable | Whether to associate the AWS OpsWorks Stacks built-in security groups with the stack's layers. |
vpc | string | The ID of the VPC that the stack is to be launched into. |
static CFN_RESOURCE_TYPE_NAME | string | The CloudFormation resource type name for this resource class. |
cfnOptions
Type:
ICfn
Options for this resource, such as condition, update policy etc.
cfnProperties
Type:
{ [string]: any }
cfnResourceType
Type:
string
AWS resource type.
creationStack
Type:
string[]
customJson
Type:
any
A string that contains user-defined, custom JSON.
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 .
defaultInstanceProfileArn
Type:
string
The Amazon Resource Name (ARN) of an IAM profile that is the default profile for all of the stack's EC2 instances.
For more information about IAM ARNs, see Using Identifiers .
logicalId
Type:
string
The logical ID for this CloudFormation stack element.
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)
.
name
Type:
string
The stack name.
Stack names can be a maximum of 64 characters.
node
Type:
Construct
The construct tree node associated with this construct.
ref
Type:
string
Return a string that will be resolved to a CloudFormation { Ref }
for this element.
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 })
.
serviceRoleArn
Type:
string
The stack's IAM role, which allows AWS OpsWorks Stacks to work with AWS resources on your behalf.
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 .
stack
Type:
Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
tags
Type:
Tag
A map that contains tag keys and tag values that are attached to a stack or layer.
- 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.
agentVersion?
Type:
string
(optional)
The default AWS OpsWorks Stacks agent version. You have the following options:.
- Auto-update - Set this parameter to
LATEST
. AWS 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. AWS 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.
attributes?
Type:
IResolvable
| { [string]: string }
(optional)
One or more user-defined key-value pairs to be added to the stack attributes.
chefConfiguration?
Type:
IResolvable
|
Chef
(optional)
A ChefConfiguration
object that specifies whether to enable Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more information, see Create a New Stack .
cloneAppIds?
Type:
string[]
(optional)
If you're cloning an AWS OpsWorks stack, a list of AWS OpsWorks application stack IDs from the source stack to include in the cloned stack.
clonePermissions?
Type:
boolean |
IResolvable
(optional)
If you're cloning an AWS OpsWorks stack, indicates whether to clone the source stack's permissions.
configurationManager?
Type:
IResolvable
|
Stack
(optional)
The configuration manager.
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.
customCookbooksSource?
Type:
IResolvable
|
Source
(optional)
Contains the information required to retrieve an app or cookbook from a repository.
For more information, see Adding Apps or Cookbooks and Recipes .
defaultAvailabilityZone?
Type:
string
(optional)
The stack's default Availability Zone, which must be in the specified region.
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.
defaultOs?
Type:
string
(optional)
The stack's default operating system, which is installed on every instance unless you specify a different operating system when you create the instance.
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 7
Red 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 AWS OpsWorks Stacks Operating Systems .
defaultRootDeviceType?
Type:
string
(optional)
The default root device type.
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 .
defaultSshKeyName?
Type:
string
(optional)
A default Amazon EC2 key pair name.
The default value is none. If you specify a key pair name, AWS 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 .
defaultSubnetId?
Type:
string
(optional)
The stack's default subnet ID.
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.
ecsClusterArn?
Type:
string
(optional)
The Amazon Resource Name (ARN) of the Amazon Elastic Container Service ( Amazon ECS ) cluster to register with the AWS OpsWorks stack.
If you specify a cluster that's registered with another AWS OpsWorks stack, AWS CloudFormation deregisters the existing association before registering the cluster.
elasticIps?
Type:
IResolvable
|
IResolvable
|
Elastic
[]
(optional)
A list of Elastic IP addresses to register with the AWS OpsWorks stack.
If you specify an IP address that's registered with another AWS OpsWorks stack, AWS CloudFormation deregisters the existing association before registering the IP address.
hostnameTheme?
Type:
string
(optional)
The stack's host name theme, with spaces replaced by underscores.
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_Goods
Clouds
Europe_Cities
Fruits
Greek_Deities_and_Titans
Legendary_creatures_from_Japan
Planets_and_Moons
Roman_Deities
Scottish_Islands
US_Cities
Wild_Cats
To obtain a generated host name, call GetHostNameSuggestion
, which returns a host name based on the current theme.
rdsDbInstances?
Type:
IResolvable
|
IResolvable
|
Rds
[]
(optional)
The Amazon Relational Database Service ( Amazon RDS ) database instance to register with the AWS OpsWorks stack.
If you specify a database instance that's registered with another AWS OpsWorks stack, AWS CloudFormation deregisters the existing association before registering the database instance.
sourceStackId?
Type:
string
(optional)
If you're cloning an AWS OpsWorks stack, the stack ID of the source AWS OpsWorks stack to clone.
useCustomCookbooks?
Type:
boolean |
IResolvable
(optional)
Whether the stack uses custom cookbooks.
useOpsworksSecurityGroups?
Type:
boolean |
IResolvable
(optional)
Whether to associate the AWS OpsWorks Stacks built-in security groups with the stack's layers.
AWS 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 - AWS 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 - AWS 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 .
vpcId?
Type:
string
(optional)
The ID of the VPC that the stack is to be launched into.
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, AWS OpsWorks Stacks infers the value of the other parameter. If you specify neither parameter, AWS 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 AWS OpsWorks Stacks with a VPC, see Running a Stack in a VPC . For more information about default VPC and EC2-Classic, see Supported Platforms .
static CFN_RESOURCE_TYPE_NAME
Type:
string
The CloudFormation resource type name for this resource class.
Methods
Name | Description |
---|---|
add | Syntactic sugar for addOverride(path, undefined) . |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Add a value to the CloudFormation Resource Metadata. |
add | Adds an override to the synthesized CloudFormation resource. |
add | Adds an override that deletes the value of a property from the resource definition. |
add | Adds an override to a resource property. |
apply | Sets the deletion policy of the resource based on the removal policy specified. |
get | Returns a token for an runtime attribute of this resource. |
get | Retrieve a value value from the CloudFormation Resource Metadata. |
inspect(inspector) | Examines the CloudFormation resource and discloses attributes. |
override | Overrides the auto-generated logical ID with a specific ID. |
to | Returns a string representation of this construct. |
protected render |
addDeletionOverride(path)
public addDeletionOverride(path: string): void
Parameters
- path
string
— The path of the value to delete.
Syntactic sugar for addOverride(path, undefined)
.
addDependsOn(target)
public addDependsOn(target: CfnResource): void
Parameters
- target
Cfn
Resource
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
addMetadata(key, value)
public addMetadata(key: string, value: any): void
Parameters
- key
string
- value
any
Add a value to the CloudFormation Resource Metadata.
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)
addOverride(path, value)
public addOverride(path: string, value: any): void
Parameters
- path
string
— - The path of the property, you can use dot notation to override values in complex types. - value
any
— - The value.
Adds an override to the synthesized CloudFormation resource.
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.
addPropertyDeletionOverride(propertyPath)
public addPropertyDeletionOverride(propertyPath: string): void
Parameters
- propertyPath
string
— The path to the property.
Adds an override that deletes the value of a property from the resource definition.
addPropertyOverride(propertyPath, value)
public addPropertyOverride(propertyPath: string, value: any): void
Parameters
- propertyPath
string
— The path of the property. - value
any
— The value.
Adds an override to a resource property.
Syntactic sugar for addOverride("Properties.<...>", value)
.
applyRemovalPolicy(policy?, options?)
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
Parameters
- policy
Removal
Policy - options
Removal
Policy Options
Sets the deletion policy of the resource based on the removal policy specified.
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
).
getAtt(attributeName)
public getAtt(attributeName: string): Reference
Parameters
- attributeName
string
— The name of the attribute.
Returns
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. resource.arn
), but this can be used for future compatibility
in case there is no generated attribute.
getMetadata(key)
public getMetadata(key: string): any
Parameters
- key
string
Returns
any
Retrieve a value value from the CloudFormation Resource Metadata.
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)
inspect(inspector)
public inspect(inspector: TreeInspector): void
Parameters
- inspector
Tree
— - tree inspector to collect and process attributes.Inspector
Examines the CloudFormation resource and discloses attributes.
overrideLogicalId(newLogicalId)
public overrideLogicalId(newLogicalId: string): void
Parameters
- newLogicalId
string
— The new logical ID to use for this stack element.
Overrides the auto-generated logical ID with a specific ID.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected renderProperties(props)
protected renderProperties(props: { [string]: any }): { [string]: any }
Parameters
- props
{ [string]: any }
Returns
{ [string]: any }