Class: AWSCDK::ResilienceHub::CfnAppProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
resilience_hub/cfn_app_props.rb

Overview

Properties for defining a CfnApp.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_template_body:, name:, resource_mappings:, app_assessment_schedule: nil, description: nil, event_subscriptions: nil, permission_model: nil, resiliency_policy_arn: nil, tags: nil) ⇒ CfnAppProps

Returns a new instance of CfnAppProps.

Parameters:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'resilience_hub/cfn_app_props.rb', line 18

def initialize(app_template_body:, name:, resource_mappings:, app_assessment_schedule: nil, description: nil, event_subscriptions: nil, permission_model: nil, resiliency_policy_arn: nil, tags: nil)
  @app_template_body = app_template_body
  Jsii::Type.check_type(@app_template_body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "appTemplateBody")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @resource_mappings = resource_mappings
  Jsii::Type.check_type(@resource_mappings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmVzaWxpZW5jZWh1Yi5DZm5BcHAuUmVzb3VyY2VNYXBwaW5nUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "resourceMappings")
  @app_assessment_schedule = app_assessment_schedule
  Jsii::Type.check_type(@app_assessment_schedule, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "appAssessmentSchedule") unless @app_assessment_schedule.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @event_subscriptions = event_subscriptions
  Jsii::Type.check_type(@event_subscriptions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmVzaWxpZW5jZWh1Yi5DZm5BcHAuRXZlbnRTdWJzY3JpcHRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "eventSubscriptions") unless @event_subscriptions.nil?
  @permission_model = permission_model.is_a?(Hash) ? ::AWSCDK::ResilienceHub::CfnApp::PermissionModelProperty.new(**permission_model.transform_keys(&:to_sym)) : permission_model
  Jsii::Type.check_type(@permission_model, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19yZXNpbGllbmNlaHViLkNmbkFwcC5QZXJtaXNzaW9uTW9kZWxQcm9wZXJ0eSJ9XX19")), "permissionModel") unless @permission_model.nil?
  @resiliency_policy_arn = resiliency_policy_arn
  Jsii::Type.check_type(@resiliency_policy_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resiliencyPolicyArn") unless @resiliency_policy_arn.nil?
  @tags = tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "tags") unless @tags.nil?
end

Instance Attribute Details

#app_assessment_scheduleString? (readonly)

Assessment execution schedule with 'Daily' or 'Disabled' values.



241
242
243
# File 'resilience_hub/cfn_app_props.rb', line 241

def app_assessment_schedule
  @app_assessment_schedule
end

#app_template_bodyString (readonly)

A JSON string that provides information about your application structure.

To learn more about the app_template_body template, see the sample template in Sample appTemplateBody template .

The app_template_body JSON string has the following structure:

  • resources

The list of logical resources that needs to be included in the AWS Resilience Hub application.

Type: Array

Don't add the resources that you want to exclude.

Each resources array item includes the following fields:

  • logical_resource_id

The logical identifier of the resource.

Type: Object

Each logical_resource_id object includes the following fields:

  • identifier

Identifier of the resource.

Type: String

  • logical_stack_name

Name of the AWS CloudFormation stack this resource belongs to.

Type: String

  • resource_group_name

Name of the resource group this resource belongs to.

Type: String

  • terraform_source_name

Name of the Terraform S3 state file this resource belongs to.

Type: String

  • eks_source_name

Name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.

This parameter accepts values in "eks-cluster/namespace" format.

Type: String

  • type

The type of resource.

Type: string

  • name

Name of the resource.

Type: String

  • additional_info

Additional configuration parameters for an AWS Resilience Hub application. If you want to implement additional_info through the AWS Resilience Hub console rather than using an API call, see Configure the application configuration parameters .

Currently, this parameter accepts a key-value mapping (in a string format) of only one failover region and one associated account.

Key: "failover-regions"

Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"

  • app_components

The list of Application Components (AppComponent) that this resource belongs to. If an AppComponent is not part of the AWS Resilience Hub application, it will be added.

Type: Array

Each app_components array item includes the following fields:

  • name

Name of the AppComponent.

Type: String

  • type

The type of AppComponent. For more information about the types of AppComponent, see Grouping resources in an AppComponent .

Type: String

  • resource_names

The list of included resources that are assigned to the AppComponent.

Type: Array of strings

  • additional_info

Additional configuration parameters for an AWS Resilience Hub application. If you want to implement additional_info through the AWS Resilience Hub console rather than using an API call, see Configure the application configuration parameters .

Currently, this parameter accepts a key-value mapping (in a string format) of only one failover region and one associated account.

Key: "failover-regions"

Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"

  • excluded_resources

The list of logical resource identifiers to be excluded from the application.

Type: Array

Don't add the resources that you want to include.

Each excluded_resources array item includes the following fields:

  • logical_resource_ids

The logical identifier of the resource.

Type: Object

You can configure only one of the following fields:

  • logical_stack_name
  • resource_group_name
  • terraform_source_name
  • eks_source_name

Each logical_resource_ids object includes the following fields:

  • identifier

The identifier of the resource.

Type: String

  • logical_stack_name

Name of the AWS CloudFormation stack this resource belongs to.

Type: String

  • resource_group_name

Name of the resource group this resource belongs to.

Type: String

  • terraform_source_name

Name of the Terraform S3 state file this resource belongs to.

Type: String

  • eks_source_name

Name of the Amazon Elastic Kubernetes Service cluster and namespace this resource belongs to.

This parameter accepts values in "eks-cluster/namespace" format.

Type: String

  • version

The AWS Resilience Hub application version.

  • additional_info

Additional configuration parameters for an AWS Resilience Hub application. If you want to implement additional_info through the AWS Resilience Hub console rather than using an API call, see Configure the application configuration parameters .

Currently, this parameter accepts a key-value mapping (in a string format) of only one failover region and one associated account.

Key: "failover-regions"

Value: "[{"region":"<REGION>", "accounts":[{"id":"<ACCOUNT_ID>"}]}]"



226
227
228
# File 'resilience_hub/cfn_app_props.rb', line 226

def app_template_body
  @app_template_body
end

#descriptionString? (readonly)

Optional description for an application.



246
247
248
# File 'resilience_hub/cfn_app_props.rb', line 246

def description
  @description
end

#event_subscriptionsAWSCDK::IResolvable, ... (readonly)

The list of events you would like to subscribe and get notification for.

Currently, AWS Resilience Hub supports notifications only for Drift detected and Scheduled assessment failure events.



253
254
255
# File 'resilience_hub/cfn_app_props.rb', line 253

def event_subscriptions
  @event_subscriptions
end

#nameString (readonly)

Name for the application.



231
232
233
# File 'resilience_hub/cfn_app_props.rb', line 231

def name
  @name
end

#permission_modelAWSCDK::IResolvable, ... (readonly)

Defines the roles and credentials that AWS Resilience Hub would use while creating the application, importing its resources, and running an assessment.



258
259
260
# File 'resilience_hub/cfn_app_props.rb', line 258

def permission_model
  @permission_model
end

#resiliency_policy_arnString? (readonly)

The Amazon Resource Name (ARN) of the resiliency policy.



263
264
265
# File 'resilience_hub/cfn_app_props.rb', line 263

def resiliency_policy_arn
  @resiliency_policy_arn
end

#resource_mappingsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::ResilienceHub::CfnApp::ResourceMappingProperty> (readonly)

An array of ResourceMapping objects.



236
237
238
# File 'resilience_hub/cfn_app_props.rb', line 236

def resource_mappings
  @resource_mappings
end

#tagsHash{String => String}? (readonly)

Tags assigned to the resource.

A tag is a label that you assign to an AWS resource. Each tag consists of a key/value pair.



270
271
272
# File 'resilience_hub/cfn_app_props.rb', line 270

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'resilience_hub/cfn_app_props.rb', line 272

def self.jsii_properties
  {
    :app_template_body => "appTemplateBody",
    :name => "name",
    :resource_mappings => "resourceMappings",
    :app_assessment_schedule => "appAssessmentSchedule",
    :description => "description",
    :event_subscriptions => "eventSubscriptions",
    :permission_model => "permissionModel",
    :resiliency_policy_arn => "resiliencyPolicyArn",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'resilience_hub/cfn_app_props.rb', line 286

def to_jsii
  result = {}
  result.merge!({
    "appTemplateBody" => @app_template_body,
    "name" => @name,
    "resourceMappings" => @resource_mappings,
    "appAssessmentSchedule" => @app_assessment_schedule,
    "description" => @description,
    "eventSubscriptions" => @event_subscriptions,
    "permissionModel" => @permission_model,
    "resiliencyPolicyArn" => @resiliency_policy_arn,
    "tags" => @tags,
  })
  result.compact
end