Class: AWSCDK::Amplify::CfnBranchProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Amplify::CfnBranchProps
- Defined in:
- amplify/cfn_branch_props.rb
Overview
Properties for defining a CfnBranch.
Instance Attribute Summary collapse
-
#app_id ⇒ String
readonly
The unique ID for an Amplify app.
-
#backend ⇒ AWSCDK::IResolvable, ...
readonly
The backend for a
Branchof an Amplify app. -
#basic_auth_config ⇒ AWSCDK::IResolvable, ...
readonly
The basic authorization credentials for a branch of an Amplify app.
-
#branch_name ⇒ String
readonly
The name for the branch.
-
#build_spec ⇒ String?
readonly
The build specification (build spec) for the branch.
-
#compute_role_arn ⇒ String?
readonly
The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app.
-
#description ⇒ String?
readonly
The description for the branch that is part of an Amplify app.
-
#enable_auto_build ⇒ Boolean, ...
readonly
Enables auto building for the branch.
-
#enable_performance_mode ⇒ Boolean, ...
readonly
Enables performance mode for the branch.
-
#enable_pull_request_preview ⇒ Boolean, ...
readonly
Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch.
-
#enable_skew_protection ⇒ Boolean, ...
readonly
Specifies whether the skew protection feature is enabled for the branch.
-
#environment_variables ⇒ AWSCDK::IResolvable, ...
readonly
The environment variables for the branch.
-
#framework ⇒ String?
readonly
The framework for the branch.
-
#pull_request_environment_name ⇒ String?
readonly
If pull request previews are enabled for this branch, you can use this property to specify a dedicated backend environment for your previews.
-
#stage ⇒ String?
readonly
Describes the current stage for the branch.
-
#tags ⇒ Array<AWSCDK::CfnTag>?
readonly
The tag for the branch.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(app_id:, branch_name:, backend: nil, basic_auth_config: nil, build_spec: nil, compute_role_arn: nil, description: nil, enable_auto_build: nil, enable_performance_mode: nil, enable_pull_request_preview: nil, enable_skew_protection: nil, environment_variables: nil, framework: nil, pull_request_environment_name: nil, stage: nil, tags: nil) ⇒ CfnBranchProps
constructor
A new instance of CfnBranchProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(app_id:, branch_name:, backend: nil, basic_auth_config: nil, build_spec: nil, compute_role_arn: nil, description: nil, enable_auto_build: nil, enable_performance_mode: nil, enable_pull_request_preview: nil, enable_skew_protection: nil, environment_variables: nil, framework: nil, pull_request_environment_name: nil, stage: nil, tags: nil) ⇒ CfnBranchProps
Returns a new instance of CfnBranchProps.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'amplify/cfn_branch_props.rb', line 25 def initialize(app_id:, branch_name:, backend: nil, basic_auth_config: nil, build_spec: nil, compute_role_arn: nil, description: nil, enable_auto_build: nil, enable_performance_mode: nil, enable_pull_request_preview: nil, enable_skew_protection: nil, environment_variables: nil, framework: nil, pull_request_environment_name: nil, stage: nil, tags: nil) @app_id = app_id Jsii::Type.check_type(@app_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "appId") @branch_name = branch_name Jsii::Type.check_type(@branch_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branchName") @backend = backend.is_a?(Hash) ? ::AWSCDK::Amplify::CfnBranch::BackendProperty.new(**backend.transform_keys(&:to_sym)) : backend Jsii::Type.check_type(@backend, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hbXBsaWZ5LkNmbkJyYW5jaC5CYWNrZW5kUHJvcGVydHkifV19fQ==")), "backend") unless @backend.nil? @basic_auth_config = basic_auth_config.is_a?(Hash) ? ::AWSCDK::Amplify::CfnBranch::BasicAuthConfigProperty.new(**basic_auth_config.transform_keys(&:to_sym)) : basic_auth_config Jsii::Type.check_type(@basic_auth_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hbXBsaWZ5LkNmbkJyYW5jaC5CYXNpY0F1dGhDb25maWdQcm9wZXJ0eSJ9XX19")), "basicAuthConfig") unless @basic_auth_config.nil? @build_spec = build_spec Jsii::Type.check_type(@build_spec, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "buildSpec") unless @build_spec.nil? @compute_role_arn = compute_role_arn Jsii::Type.check_type(@compute_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "computeRoleArn") unless @compute_role_arn.nil? @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil? @enable_auto_build = enable_auto_build Jsii::Type.check_type(@enable_auto_build, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enableAutoBuild") unless @enable_auto_build.nil? @enable_performance_mode = enable_performance_mode Jsii::Type.check_type(@enable_performance_mode, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enablePerformanceMode") unless @enable_performance_mode.nil? @enable_pull_request_preview = enable_pull_request_preview Jsii::Type.check_type(@enable_pull_request_preview, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enablePullRequestPreview") unless @enable_pull_request_preview.nil? @enable_skew_protection = enable_skew_protection Jsii::Type.check_type(@enable_skew_protection, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enableSkewProtection") unless @enable_skew_protection.nil? @environment_variables = environment_variables Jsii::Type.check_type(@environment_variables, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYW1wbGlmeS5DZm5CcmFuY2guRW52aXJvbm1lbnRWYXJpYWJsZVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "environmentVariables") unless @environment_variables.nil? @framework = framework Jsii::Type.check_type(@framework, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "framework") unless @framework.nil? @pull_request_environment_name = pull_request_environment_name Jsii::Type.check_type(@pull_request_environment_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pullRequestEnvironmentName") unless @pull_request_environment_name.nil? @stage = stage Jsii::Type.check_type(@stage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stage") unless @stage.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil? end |
Instance Attribute Details
#app_id ⇒ String (readonly)
The unique ID for an Amplify app.
64 65 66 |
# File 'amplify/cfn_branch_props.rb', line 64 def app_id @app_id end |
#backend ⇒ AWSCDK::IResolvable, ... (readonly)
The backend for a Branch of an Amplify app. Use for a backend created from an CloudFormation stack.
This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.
76 77 78 |
# File 'amplify/cfn_branch_props.rb', line 76 def backend @backend end |
#basic_auth_config ⇒ AWSCDK::IResolvable, ... (readonly)
The basic authorization credentials for a branch of an Amplify app.
You must base64-encode the authorization credentials and provide them in the format user:password .
83 84 85 |
# File 'amplify/cfn_branch_props.rb', line 83 def basic_auth_config @basic_auth_config end |
#branch_name ⇒ String (readonly)
The name for the branch.
69 70 71 |
# File 'amplify/cfn_branch_props.rb', line 69 def branch_name @branch_name end |
#build_spec ⇒ String? (readonly)
The build specification (build spec) for the branch.
88 89 90 |
# File 'amplify/cfn_branch_props.rb', line 88 def build_spec @build_spec end |
#compute_role_arn ⇒ String? (readonly)
The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app.
The SSR Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide .
95 96 97 |
# File 'amplify/cfn_branch_props.rb', line 95 def compute_role_arn @compute_role_arn end |
#description ⇒ String? (readonly)
The description for the branch that is part of an Amplify app.
100 101 102 |
# File 'amplify/cfn_branch_props.rb', line 100 def description @description end |
#enable_auto_build ⇒ Boolean, ... (readonly)
Enables auto building for the branch.
105 106 107 |
# File 'amplify/cfn_branch_props.rb', line 105 def enable_auto_build @enable_auto_build end |
#enable_performance_mode ⇒ Boolean, ... (readonly)
Enables performance mode for the branch.
Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.
112 113 114 |
# File 'amplify/cfn_branch_props.rb', line 112 def enable_performance_mode @enable_performance_mode end |
#enable_pull_request_preview ⇒ Boolean, ... (readonly)
Specifies whether Amplify Hosting creates a preview for each pull request that is made for this branch.
If this property is enabled, Amplify deploys your app to a unique preview URL after each pull request is opened. Development and QA teams can use this preview to test the pull request before it's merged into a production or integration branch.
To provide backend support for your preview, Amplify automatically provisions a temporary backend environment that it deletes when the pull request is closed. If you want to specify a dedicated backend environment for your previews, use the PullRequestEnvironmentName property.
For more information, see Web Previews in the AWS Amplify Hosting User Guide .
123 124 125 |
# File 'amplify/cfn_branch_props.rb', line 123 def enable_pull_request_preview @enable_pull_request_preview end |
#enable_skew_protection ⇒ Boolean, ... (readonly)
Specifies whether the skew protection feature is enabled for the branch.
Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see Skew protection for Amplify deployments in the Amplify User Guide .
130 131 132 |
# File 'amplify/cfn_branch_props.rb', line 130 def enable_skew_protection @enable_skew_protection end |
#environment_variables ⇒ AWSCDK::IResolvable, ... (readonly)
The environment variables for the branch.
135 136 137 |
# File 'amplify/cfn_branch_props.rb', line 135 def environment_variables @environment_variables end |
#framework ⇒ String? (readonly)
The framework for the branch.
140 141 142 |
# File 'amplify/cfn_branch_props.rb', line 140 def framework @framework end |
#pull_request_environment_name ⇒ String? (readonly)
If pull request previews are enabled for this branch, you can use this property to specify a dedicated backend environment for your previews.
For example, you could specify an environment named prod , test , or dev that you initialized with the Amplify CLI and mapped to this branch.
To enable pull request previews, set the EnablePullRequestPreview property to true .
If you don't specify an environment, Amplify Hosting provides backend support for each preview by automatically provisioning a temporary backend environment. Amplify Hosting deletes this environment when the pull request is closed.
For more information about creating backend environments, see Feature Branch Deployments and Team Workflows in the AWS Amplify Hosting User Guide .
153 154 155 |
# File 'amplify/cfn_branch_props.rb', line 153 def pull_request_environment_name @pull_request_environment_name end |
#stage ⇒ String? (readonly)
Describes the current stage for the branch.
158 159 160 |
# File 'amplify/cfn_branch_props.rb', line 158 def stage @stage end |
#tags ⇒ Array<AWSCDK::CfnTag>? (readonly)
The tag for the branch.
163 164 165 |
# File 'amplify/cfn_branch_props.rb', line 163 def @tags end |
Class Method Details
.jsii_properties ⇒ Object
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'amplify/cfn_branch_props.rb', line 165 def self.jsii_properties { :app_id => "appId", :branch_name => "branchName", :backend => "backend", :basic_auth_config => "basicAuthConfig", :build_spec => "buildSpec", :compute_role_arn => "computeRoleArn", :description => "description", :enable_auto_build => "enableAutoBuild", :enable_performance_mode => "enablePerformanceMode", :enable_pull_request_preview => "enablePullRequestPreview", :enable_skew_protection => "enableSkewProtection", :environment_variables => "environmentVariables", :framework => "framework", :pull_request_environment_name => "pullRequestEnvironmentName", :stage => "stage", :tags => "tags", } end |
Instance Method Details
#to_jsii ⇒ Object
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'amplify/cfn_branch_props.rb', line 186 def to_jsii result = {} result.merge!({ "appId" => @app_id, "branchName" => @branch_name, "backend" => @backend, "basicAuthConfig" => @basic_auth_config, "buildSpec" => @build_spec, "computeRoleArn" => @compute_role_arn, "description" => @description, "enableAutoBuild" => @enable_auto_build, "enablePerformanceMode" => @enable_performance_mode, "enablePullRequestPreview" => @enable_pull_request_preview, "enableSkewProtection" => @enable_skew_protection, "environmentVariables" => @environment_variables, "framework" => @framework, "pullRequestEnvironmentName" => @pull_request_environment_name, "stage" => @stage, "tags" => @tags, }) result.compact end |