StackProps
Initializer
import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore"
&alicloudroscdkcore.StackProps {
Description: *string,
EnableResourcePropertyConstraint: *bool,
Env: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.Environment,
Metadata: *map[string]interface{},
StackName: *string,
Synthesizer: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.IStackSynthesizer,
Tags: *map[string]*string,
Version: *string,
}
Properties
Name | Type | Description |
---|---|---|
Description |
*string |
A description of the stack. |
EnableResourcePropertyConstraint |
*bool |
No description. |
Env |
Environment |
The ALIYUN environment (account/region) where this stack will be deployed. |
Metadata |
*map[string]interface{} |
No description. |
StackName |
*string |
Name to deploy the stack with. |
Synthesizer |
IStackSynthesizer |
Synthesis method to use while deploying this stack. |
Tags |
map[string]string |
Stack tags that will be applied to all the taggable resources and the stack itself. |
Version |
*string |
No description. |
Description
Optional
Description *string
- Type: *string
- Default: No description.
A description of the stack.
EnableResourcePropertyConstraint
Optional
EnableResourcePropertyConstraint *bool
- Type: *bool
Env
Optional
Env Environment
- Type: Environment
- Default: The environment of the containing
Stage
if available, otherwise create the stack will be environment-agnostic.
The ALIYUN environment (account/region) where this stack will be deployed.
Set the region
/account
fields of env
to either a concrete value to
select the indicated environment (recommended for production stacks), or to
the values of environment variables
CDK_DEFAULT_REGION
/CDK_DEFAULT_ACCOUNT
to let the target environment
depend on the ALIYUN credentials/configuration that the CDK CLI is executed
under (recommended for development stacks).
If the Stack
is instantiated inside a Stage
, any undefined
region
/account
fields from env
will default to the same field on the
encompassing Stage
, if configured there.
If either region
or account
are not set nor inherited from Stage
, the
Stack will be considered "environment-agnostic"". Environment-agnostic
stacks can be deployed to any environment but may not be able to take
advantage of all features of the CDK.
Example
// Example automatically generated from non-compiling source. May contain errors.
// Use a concrete account and region to deploy this stack to:
// `.account` and `.region` will simply return these values.
// Use a concrete account and region to deploy this stack to:
// `.account` and `.region` will simply return these values.
NewStack(app, jsii.String("Stack1"), map[string]map[string]*string{
"env": map[string]*string{
"account": jsii.String("123456789012"),
"region": jsii.String("cn-hangzhou"),
},
})
// Use the CLI's current credentials to determine the target environment:
// `.account` and `.region` will reflect the account+region the CLI
// is configured to use (based on the user CLI credentials)
// Use the CLI's current credentials to determine the target environment:
// `.account` and `.region` will reflect the account+region the CLI
// is configured to use (based on the user CLI credentials)
NewStack(app, jsii.String("Stack2"), map[string]map[string]interface{}{
"env": map[string]interface{}{
"account": process.env.CDK_DEFAULT_ACCOUNT,
"region": process.env.CDK_DEFAULT_REGION,
},
})
// Define multiple stacks stage associated with an environment
myStage := NewStage(app, jsii.String("MyStage"), map[string]map[string]*string{
"env": map[string]*string{
"account": jsii.String("123456789012"),
"region": jsii.String("cn-hangzhou"),
},
})
// both of these stacks will use the stage's account/region:
// `.account` and `.region` will resolve to the concrete values as above
// both of these stacks will use the stage's account/region:
// `.account` and `.region` will resolve to the concrete values as above
NewMyStack(myStage, jsii.String("Stack1"))
NewYourStack(myStage, jsii.String("Stack2"))
// Define an environment-agnostic stack:
// `.account` and `.region` will resolve to `{ "Ref": "ALIYUN::AccountId" }` and `{ "Ref": "ALIYUN::Region" }` respectively.
// which will only resolve to actual values by ROS during deployment.
// Define an environment-agnostic stack:
// `.account` and `.region` will resolve to `{ "Ref": "ALIYUN::AccountId" }` and `{ "Ref": "ALIYUN::Region" }` respectively.
// which will only resolve to actual values by ROS during deployment.
NewMyStack(app, jsii.String("Stack1"))
Metadata
Optional
Metadata *map[string]interface{}
- Type: *map[string]interface{}
StackName
Optional
StackName *string
- Type: *string
- Default: Derived from construct path.
Name to deploy the stack with.
Synthesizer
Optional
Synthesizer IStackSynthesizer
- Type: IStackSynthesizer
- Default:
DefaultStackSynthesizer
Synthesis method to use while deploying this stack.
Tags
Optional
Tags *map[string]*string
- Type: map[string]string
- Default: {}
Stack tags that will be applied to all the taggable resources and the stack itself.
Version
Optional
Version *string
- Type: *string