StackProps
Initializer
using AlibabaCloud.SDK.ROS.CDK.Core;
new StackProps {
string Description = null,
bool EnableResourcePropertyConstraint = null,
Environment Env = null,
System.Collections.Generic.IDictionary<string, object> Metadata = null,
string StackName = null,
IStackSynthesizer Synthesizer = null,
System.Collections.Generic.IDictionary<string, string> Tags = null,
string Version = null
};
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 |
System.Collections.Generic.IDictionary |
No description. |
StackName |
string |
Name to deploy the stack with. |
Synthesizer |
IStackSynthesizer |
Synthesis method to use while deploying this stack. |
Tags |
System.Collections.Generic.IDictionary |
Stack tags that will be applied to all the taggable resources and the stack itself. |
Version |
string |
No description. |
DescriptionOptional
public string Description { get; set; }
- Type: string
- Default: No description.
A description of the stack.
EnableResourcePropertyConstraintOptional
public bool EnableResourcePropertyConstraint { get; set; }
- Type: bool
EnvOptional
public Environment Env { get; set; }
- Type: Environment
- Default: The environment of the containing
Stageif 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.
new Stack(app, "Stack1", new Struct {
Env = new Struct {
Account = "123456789012",
Region = "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)
new Stack(app, "Stack2", new Struct {
Env = new Struct {
Account = process.Env.CDK_DEFAULT_ACCOUNT,
Region = process.Env.CDK_DEFAULT_REGION
}
});
// Define multiple stacks stage associated with an environment
var myStage = new Stage(app, "MyStage", new Struct {
Env = new Struct {
Account = "123456789012",
Region = "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
new MyStack(myStage, "Stack1");
new YourStack(myStage, "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.
new MyStack(app, "Stack1");
MetadataOptional
public System.Collections.Generic.IDictionary<string, object> Metadata { get; set; }
- Type: System.Collections.Generic.IDictionary
StackNameOptional
public string StackName { get; set; }
- Type: string
- Default: Derived from construct path.
Name to deploy the stack with.
SynthesizerOptional
public IStackSynthesizer Synthesizer { get; set; }
- Type: IStackSynthesizer
- Default:
DefaultStackSynthesizer
Synthesis method to use while deploying this stack.
TagsOptional
public System.Collections.Generic.IDictionary<string, string> Tags { get; set; }
- Type: System.Collections.Generic.IDictionary
- Default: {}
Stack tags that will be applied to all the taggable resources and the stack itself.
VersionOptional
public string Version { get; set; }
- Type: string