Class: AWSCDK::CodeDeploy::LambdaDeploymentGroupProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
code_deploy/lambda_deployment_group_props.rb

Overview

Construction properties for LambdaDeploymentGroup.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_alias:, alarms: nil, application: nil, auto_rollback: nil, deployment_config: nil, deployment_group_name: nil, ignore_alarm_configuration: nil, ignore_poll_alarms_failure: nil, post_hook: nil, pre_hook: nil, role: nil) ⇒ LambdaDeploymentGroupProps

Returns a new instance of LambdaDeploymentGroupProps.

Parameters:

  • _alias (AWSCDK::Lambda::Alias)

    Lambda Alias to shift traffic. Updating the version of the alias will trigger a CodeDeploy deployment.

  • alarms (Array<AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef>, nil) (defaults to: nil)

    The CloudWatch alarms associated with this Deployment Group.

  • application (AWSCDK::CodeDeploy::ILambdaApplication, nil) (defaults to: nil)

    The reference to the CodeDeploy Lambda Application that this Deployment Group belongs to.

  • auto_rollback (AWSCDK::CodeDeploy::AutoRollbackConfig, nil) (defaults to: nil)

    The auto-rollback configuration for this Deployment Group.

  • deployment_config (AWSCDK::CodeDeploy::ILambdaDeploymentConfig, nil) (defaults to: nil)

    The Deployment Configuration this Deployment Group uses.

  • deployment_group_name (String, nil) (defaults to: nil)

    The physical, human-readable name of the CodeDeploy Deployment Group.

  • ignore_alarm_configuration (Boolean, nil) (defaults to: nil)

    Whether to skip the step of checking CloudWatch alarms during the deployment process.

  • ignore_poll_alarms_failure (Boolean, nil) (defaults to: nil)

    Whether to continue a deployment even if fetching the alarm status from CloudWatch failed.

  • post_hook (AWSCDK::Lambda::IFunction, nil) (defaults to: nil)

    The Lambda function to run after traffic routing starts.

  • pre_hook (AWSCDK::Lambda::IFunction, nil) (defaults to: nil)

    The Lambda function to run before traffic routing starts.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The service Role of this Deployment Group.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'code_deploy/lambda_deployment_group_props.rb', line 18

def initialize(_alias:, alarms: nil, application: nil, auto_rollback: nil, deployment_config: nil, deployment_group_name: nil, ignore_alarm_configuration: nil, ignore_poll_alarms_failure: nil, post_hook: nil, pre_hook: nil, role: nil)
  @_alias = _alias
  Jsii::Type.check_type(@_alias, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkFsaWFzIn0=")), "alias")
  @alarms = alarms
  Jsii::Type.check_type(@alarms, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX2Nsb3Vkd2F0Y2guSUFsYXJtUmVmIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "alarms") unless @alarms.nil?
  @application = application
  Jsii::Type.check_type(@application, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5JTGFtYmRhQXBwbGljYXRpb24ifQ==")), "application") unless @application.nil?
  @auto_rollback = auto_rollback.is_a?(Hash) ? ::AWSCDK::CodeDeploy::AutoRollbackConfig.new(**auto_rollback.transform_keys(&:to_sym)) : auto_rollback
  Jsii::Type.check_type(@auto_rollback, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5BdXRvUm9sbGJhY2tDb25maWcifQ==")), "autoRollback") unless @auto_rollback.nil?
  @deployment_config = deployment_config
  Jsii::Type.check_type(@deployment_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWRlcGxveS5JTGFtYmRhRGVwbG95bWVudENvbmZpZyJ9")), "deploymentConfig") unless @deployment_config.nil?
  @deployment_group_name = deployment_group_name
  Jsii::Type.check_type(@deployment_group_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deploymentGroupName") unless @deployment_group_name.nil?
  @ignore_alarm_configuration = ignore_alarm_configuration
  Jsii::Type.check_type(@ignore_alarm_configuration, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ignoreAlarmConfiguration") unless @ignore_alarm_configuration.nil?
  @ignore_poll_alarms_failure = ignore_poll_alarms_failure
  Jsii::Type.check_type(@ignore_poll_alarms_failure, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ignorePollAlarmsFailure") unless @ignore_poll_alarms_failure.nil?
  @post_hook = post_hook
  Jsii::Type.check_type(@post_hook, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "postHook") unless @post_hook.nil?
  @pre_hook = pre_hook
  Jsii::Type.check_type(@pre_hook, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "preHook") unless @pre_hook.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
end

Instance Attribute Details

#_aliasAWSCDK::Lambda::Alias (readonly)

Lambda Alias to shift traffic. Updating the version of the alias will trigger a CodeDeploy deployment.

[disable-awslint:ref-via-interface] since we need to modify the alias CFN resource update policy



48
49
50
# File 'code_deploy/lambda_deployment_group_props.rb', line 48

def _alias
  @_alias
end

#alarmsArray<AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef>? (readonly)

Note:

Default: []

The CloudWatch alarms associated with this Deployment Group.

CodeDeploy will stop (and optionally roll back) a deployment if during it any of the alarms trigger.

Alarms can also be added after the Deployment Group is created using the #addAlarm method.



59
60
61
# File 'code_deploy/lambda_deployment_group_props.rb', line 59

def alarms
  @alarms
end

#applicationAWSCDK::CodeDeploy::ILambdaApplication? (readonly)

Note:

Default: - One will be created for you.

The reference to the CodeDeploy Lambda Application that this Deployment Group belongs to.



64
65
66
# File 'code_deploy/lambda_deployment_group_props.rb', line 64

def application
  @application
end

#auto_rollbackAWSCDK::CodeDeploy::AutoRollbackConfig? (readonly)

Note:

Default: - default AutoRollbackConfig.

The auto-rollback configuration for this Deployment Group.



69
70
71
# File 'code_deploy/lambda_deployment_group_props.rb', line 69

def auto_rollback
  @auto_rollback
end

#deployment_configAWSCDK::CodeDeploy::ILambdaDeploymentConfig? (readonly)

Note:

Default: LambdaDeploymentConfig.CANARY_10PERCENT_5MINUTES

The Deployment Configuration this Deployment Group uses.



74
75
76
# File 'code_deploy/lambda_deployment_group_props.rb', line 74

def deployment_config
  @deployment_config
end

#deployment_group_nameString? (readonly)

Note:

Default: - An auto-generated name will be used.

The physical, human-readable name of the CodeDeploy Deployment Group.

Returns:

  • (String, nil)


79
80
81
# File 'code_deploy/lambda_deployment_group_props.rb', line 79

def deployment_group_name
  @deployment_group_name
end

#ignore_alarm_configurationBoolean? (readonly)

Note:

Default: - false

Whether to skip the step of checking CloudWatch alarms during the deployment process.

Returns:

  • (Boolean, nil)


84
85
86
# File 'code_deploy/lambda_deployment_group_props.rb', line 84

def ignore_alarm_configuration
  @ignore_alarm_configuration
end

#ignore_poll_alarms_failureBoolean? (readonly)

Note:

Default: false

Whether to continue a deployment even if fetching the alarm status from CloudWatch failed.

Returns:

  • (Boolean, nil)


89
90
91
# File 'code_deploy/lambda_deployment_group_props.rb', line 89

def ignore_poll_alarms_failure
  @ignore_poll_alarms_failure
end

#post_hookAWSCDK::Lambda::IFunction? (readonly)

Note:

Default: - None.

The Lambda function to run after traffic routing starts.

Returns:



94
95
96
# File 'code_deploy/lambda_deployment_group_props.rb', line 94

def post_hook
  @post_hook
end

#pre_hookAWSCDK::Lambda::IFunction? (readonly)

Note:

Default: - None.

The Lambda function to run before traffic routing starts.

Returns:



99
100
101
# File 'code_deploy/lambda_deployment_group_props.rb', line 99

def pre_hook
  @pre_hook
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A new Role will be created.

The service Role of this Deployment Group.

Returns:



104
105
106
# File 'code_deploy/lambda_deployment_group_props.rb', line 104

def role
  @role
end

Class Method Details

.jsii_propertiesObject



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'code_deploy/lambda_deployment_group_props.rb', line 106

def self.jsii_properties
  {
    :_alias => "alias",
    :alarms => "alarms",
    :application => "application",
    :auto_rollback => "autoRollback",
    :deployment_config => "deploymentConfig",
    :deployment_group_name => "deploymentGroupName",
    :ignore_alarm_configuration => "ignoreAlarmConfiguration",
    :ignore_poll_alarms_failure => "ignorePollAlarmsFailure",
    :post_hook => "postHook",
    :pre_hook => "preHook",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'code_deploy/lambda_deployment_group_props.rb', line 122

def to_jsii
  result = {}
  result.merge!({
    "alias" => @_alias,
    "alarms" => @alarms,
    "application" => @application,
    "autoRollback" => @auto_rollback,
    "deploymentConfig" => @deployment_config,
    "deploymentGroupName" => @deployment_group_name,
    "ignoreAlarmConfiguration" => @ignore_alarm_configuration,
    "ignorePollAlarmsFailure" => @ignore_poll_alarms_failure,
    "postHook" => @post_hook,
    "preHook" => @pre_hook,
    "role" => @role,
  })
  result.compact
end