Class: AWSCDK::Stage
- Inherits:
-
Constructs::Construct
- Object
- Constructs::Construct
- AWSCDK::Stage
- Defined in:
- stage.rb
Overview
An abstract application modeling unit consisting of Stacks that should be deployed together.
Derive a subclass of Stage and use it to model a single instance of your
application.
You can then instantiate your subclass multiple times to model multiple copies of your application which should be deployed to different environments.
Direct Known Subclasses
Class Method Summary collapse
-
.is_stage(x) ⇒ Boolean
Test whether the given construct is a stage.
- .jsii_overridable_methods ⇒ Object
-
.of(construct) ⇒ AWSCDK::Stage?
Return the stage this construct is contained with, if available.
Instance Method Summary collapse
-
#account ⇒ String?
The default account for all resources defined within this stage.
-
#artifact_id ⇒ String
Artifact ID of the assembly if it is a nested stage.
-
#asset_outdir ⇒ String
The cloud assembly asset output directory.
-
#initialize(scope, id, props = nil) ⇒ Stage
constructor
A new instance of Stage.
-
#node ⇒ Constructs::Node
The tree node.
-
#outdir ⇒ String
The cloud assembly output directory.
-
#parent_stage ⇒ AWSCDK::Stage?
The parent stage or
undefinedif this is the app. -
#policy_validation_beta1 ⇒ Array<AWSCDK::IPolicyValidationPluginBeta1>
Validation plugins to run during synthesis.
-
#region ⇒ String?
The default region for all resources defined within this stage.
-
#stage_name ⇒ String
The name of the stage.
-
#synth(options = nil) ⇒ AWSCDK::CXAPI::CloudAssembly
Synthesize this stage into a cloud assembly.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props = nil) ⇒ Stage
Returns a new instance of Stage.
18 19 20 21 22 23 24 |
# File 'stage.rb', line 18 def initialize(scope, id, props = nil) props = props.is_a?(Hash) ? ::AWSCDK::StageProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TdGFnZVByb3BzIn0=")), "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.is_stage(x) ⇒ Boolean
Test whether the given construct is a stage.
47 48 49 50 |
# File 'stage.rb', line 47 def self.is_stage(x) Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x") Jsii::Kernel.instance.call_static("aws-cdk-lib.Stage", "isStage", [x]) end |
.jsii_overridable_methods ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'stage.rb', line 26 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :artifact_id => { kind: :property, name: "artifactId", is_optional: false }, :asset_outdir => { kind: :property, name: "assetOutdir", is_optional: false }, :outdir => { kind: :property, name: "outdir", is_optional: false }, :policy_validation_beta1 => { kind: :property, name: "policyValidationBeta1", is_optional: false }, :stage_name => { kind: :property, name: "stageName", is_optional: false }, :account => { kind: :property, name: "account", is_optional: true }, :parent_stage => { kind: :property, name: "parentStage", is_optional: true }, :region => { kind: :property, name: "region", is_optional: true }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :synth => { kind: :method, name: "synth", is_optional: false }, } end |
.of(construct) ⇒ AWSCDK::Stage?
Return the stage this construct is contained with, if available.
If called on a nested stage, returns its parent.
59 60 61 62 |
# File 'stage.rb', line 59 def self.of(construct) Jsii::Type.check_type(construct, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "construct") Jsii::Kernel.instance.call_static("aws-cdk-lib.Stage", "of", [construct]) end |
Instance Method Details
#account ⇒ String?
The default account for all resources defined within this stage.
118 119 120 |
# File 'stage.rb', line 118 def account() jsii_get_property("account") end |
#artifact_id ⇒ String
Artifact ID of the assembly if it is a nested stage. The root stage (app) will return an empty string.
Derived from the construct path.
76 77 78 |
# File 'stage.rb', line 76 def artifact_id() jsii_get_property("artifactId") end |
#asset_outdir ⇒ String
The cloud assembly asset output directory.
83 84 85 |
# File 'stage.rb', line 83 def asset_outdir() jsii_get_property("assetOutdir") end |
#node ⇒ Constructs::Node
The tree node.
67 68 69 |
# File 'stage.rb', line 67 def node() jsii_get_property("node") end |
#outdir ⇒ String
The cloud assembly output directory.
90 91 92 |
# File 'stage.rb', line 90 def outdir() jsii_get_property("outdir") end |
#parent_stage ⇒ AWSCDK::Stage?
The parent stage or undefined if this is the app.
*
127 128 129 |
# File 'stage.rb', line 127 def parent_stage() jsii_get_property("parentStage") end |
#policy_validation_beta1 ⇒ Array<AWSCDK::IPolicyValidationPluginBeta1>
Default: - no validation plugins are used
Validation plugins to run during synthesis.
If any plugin reports any violation, synthesis will be interrupted and the report displayed to the user.
101 102 103 |
# File 'stage.rb', line 101 def policy_validation_beta1() jsii_get_property("policyValidationBeta1") end |
#region ⇒ String?
The default region for all resources defined within this stage.
134 135 136 |
# File 'stage.rb', line 134 def region() jsii_get_property("region") end |
#stage_name ⇒ String
The name of the stage.
Based on names of the parent stages separated by hypens.
111 112 113 |
# File 'stage.rb', line 111 def stage_name() jsii_get_property("stageName") end |
#synth(options = nil) ⇒ AWSCDK::CXAPI::CloudAssembly
Synthesize this stage into a cloud assembly.
Once an assembly has been synthesized, it cannot be modified. Subsequent calls will return the same assembly.
168 169 170 171 172 |
# File 'stage.rb', line 168 def synth( = nil) = .is_a?(Hash) ? ::AWSCDK::StageSynthesisOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TdGFnZVN5bnRoZXNpc09wdGlvbnMifQ==")), "options") unless .nil? jsii_call_method("synth", []) end |
#to_string ⇒ String
Returns a string representation of this construct.
141 142 143 |
# File 'stage.rb', line 141 def to_string() jsii_call_method("toString", []) end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
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.
154 155 156 157 158 159 |
# File 'stage.rb', line 154 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |