Class: AWSCDK::CfnCodeDeployLambdaAliasUpdate

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cfn_code_deploy_lambda_alias_update.rb

Overview

To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application_name:, deployment_group_name:, after_allow_traffic_hook: nil, before_allow_traffic_hook: nil) ⇒ CfnCodeDeployLambdaAliasUpdate

Returns a new instance of CfnCodeDeployLambdaAliasUpdate.

Parameters:

  • application_name (String)

    The name of the AWS CodeDeploy application.

  • deployment_group_name (String)

    The name of the AWS CodeDeploy deployment group.

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

    The name of the Lambda function to run after traffic routing completes.

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

    The name of the Lambda function to run before traffic routing starts.



11
12
13
14
15
16
17
18
19
20
# File 'cfn_code_deploy_lambda_alias_update.rb', line 11

def initialize(application_name:, deployment_group_name:, after_allow_traffic_hook: nil, before_allow_traffic_hook: nil)
  @application_name = application_name
  Jsii::Type.check_type(@application_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "applicationName")
  @deployment_group_name = deployment_group_name
  Jsii::Type.check_type(@deployment_group_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deploymentGroupName")
  @after_allow_traffic_hook = after_allow_traffic_hook
  Jsii::Type.check_type(@after_allow_traffic_hook, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "afterAllowTrafficHook") unless @after_allow_traffic_hook.nil?
  @before_allow_traffic_hook = before_allow_traffic_hook
  Jsii::Type.check_type(@before_allow_traffic_hook, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "beforeAllowTrafficHook") unless @before_allow_traffic_hook.nil?
end

Instance Attribute Details

#after_allow_traffic_hookString? (readonly)

The name of the Lambda function to run after traffic routing completes.

Returns:

  • (String, nil)


35
36
37
# File 'cfn_code_deploy_lambda_alias_update.rb', line 35

def after_allow_traffic_hook
  @after_allow_traffic_hook
end

#application_nameString (readonly)

The name of the AWS CodeDeploy application.

Returns:

  • (String)


25
26
27
# File 'cfn_code_deploy_lambda_alias_update.rb', line 25

def application_name
  @application_name
end

#before_allow_traffic_hookString? (readonly)

The name of the Lambda function to run before traffic routing starts.

Returns:

  • (String, nil)


39
40
41
# File 'cfn_code_deploy_lambda_alias_update.rb', line 39

def before_allow_traffic_hook
  @before_allow_traffic_hook
end

#deployment_group_nameString (readonly)

The name of the AWS CodeDeploy deployment group.

This is where the traffic-shifting policy is set.

Returns:

  • (String)


31
32
33
# File 'cfn_code_deploy_lambda_alias_update.rb', line 31

def deployment_group_name
  @deployment_group_name
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
48
# File 'cfn_code_deploy_lambda_alias_update.rb', line 41

def self.jsii_properties
  {
    :application_name => "applicationName",
    :deployment_group_name => "deploymentGroupName",
    :after_allow_traffic_hook => "afterAllowTrafficHook",
    :before_allow_traffic_hook => "beforeAllowTrafficHook",
  }
end

Instance Method Details

#to_jsiiObject



50
51
52
53
54
55
56
57
58
59
# File 'cfn_code_deploy_lambda_alias_update.rb', line 50

def to_jsii
  result = {}
  result.merge!({
    "applicationName" => @application_name,
    "deploymentGroupName" => @deployment_group_name,
    "afterAllowTrafficHook" => @after_allow_traffic_hook,
    "beforeAllowTrafficHook" => @before_allow_traffic_hook,
  })
  result.compact
end