Class: AWSCDK::SecretsManager::RotationScheduleOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
secrets_manager/rotation_schedule_options.rb

Overview

Options to add a rotation schedule to a secret.

Direct Known Subclasses

RotationScheduleProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(automatically_after: nil, hosted_rotation: nil, rotate_immediately_on_update: nil, rotation_lambda: nil) ⇒ RotationScheduleOptions

Returns a new instance of RotationScheduleOptions.

Parameters:

  • automatically_after (AWSCDK::Duration, nil) (defaults to: nil)

    Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.

  • hosted_rotation (AWSCDK::SecretsManager::HostedRotation, nil) (defaults to: nil)

    Hosted rotation.

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

    Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.

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

    A Lambda function that can rotate the secret.



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

def initialize(automatically_after: nil, hosted_rotation: nil, rotate_immediately_on_update: nil, rotation_lambda: nil)
  @automatically_after = automatically_after
  Jsii::Type.check_type(@automatically_after, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "automaticallyAfter") unless @automatically_after.nil?
  @hosted_rotation = hosted_rotation
  Jsii::Type.check_type(@hosted_rotation, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VjcmV0c21hbmFnZXIuSG9zdGVkUm90YXRpb24ifQ==")), "hostedRotation") unless @hosted_rotation.nil?
  @rotate_immediately_on_update = rotate_immediately_on_update
  Jsii::Type.check_type(@rotate_immediately_on_update, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "rotateImmediatelyOnUpdate") unless @rotate_immediately_on_update.nil?
  @rotation_lambda = rotation_lambda
  Jsii::Type.check_type(@rotation_lambda, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "rotationLambda") unless @rotation_lambda.nil?
end

Instance Attribute Details

#automatically_afterAWSCDK::Duration? (readonly)

Note:

Default: Duration.days(30)

Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.

The minimum value is 4 hours. The maximum value is 1000 days.

A value of zero (Duration.days(0)) will not create RotationRules.

Returns:



31
32
33
# File 'secrets_manager/rotation_schedule_options.rb', line 31

def automatically_after
  @automatically_after
end

#hosted_rotationAWSCDK::SecretsManager::HostedRotation? (readonly)

Note:

Default: - either rotationLambda or hostedRotation must be specified

Hosted rotation.



36
37
38
# File 'secrets_manager/rotation_schedule_options.rb', line 36

def hosted_rotation
  @hosted_rotation
end

#rotate_immediately_on_updateBoolean? (readonly)

Note:

Default: true

Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.

Returns:

  • (Boolean, nil)


41
42
43
# File 'secrets_manager/rotation_schedule_options.rb', line 41

def rotate_immediately_on_update
  @rotate_immediately_on_update
end

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

Note:

Default: - either rotationLambda or hostedRotation must be specified

A Lambda function that can rotate the secret.

Returns:



46
47
48
# File 'secrets_manager/rotation_schedule_options.rb', line 46

def rotation_lambda
  @rotation_lambda
end

Class Method Details

.jsii_propertiesObject



48
49
50
51
52
53
54
55
# File 'secrets_manager/rotation_schedule_options.rb', line 48

def self.jsii_properties
  {
    :automatically_after => "automaticallyAfter",
    :hosted_rotation => "hostedRotation",
    :rotate_immediately_on_update => "rotateImmediatelyOnUpdate",
    :rotation_lambda => "rotationLambda",
  }
end

Instance Method Details

#to_jsiiObject



57
58
59
60
61
62
63
64
65
66
# File 'secrets_manager/rotation_schedule_options.rb', line 57

def to_jsii
  result = {}
  result.merge!({
    "automaticallyAfter" => @automatically_after,
    "hostedRotation" => @hosted_rotation,
    "rotateImmediatelyOnUpdate" => @rotate_immediately_on_update,
    "rotationLambda" => @rotation_lambda,
  })
  result.compact
end