Class CfnRotationSchedule
A CloudFormation AWS::SecretsManager::RotationSchedule
.
Inherited Members
Namespace: Amazon.CDK.AWS.SecretsManager
Assembly: Amazon.CDK.AWS.SecretsManager.dll
Syntax (csharp)
public class CfnRotationSchedule : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnRotationSchedule
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
Sets the rotation schedule and Lambda rotation function for a secret. For more information, see How rotation works .
For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
For the rotation function, you have two options:
For database secrets, if you define both the secret and the database or service in the AWS CloudFormation template, then you need to define the AWS::SecretsManager::SecretTargetAttachment resource to populate the secret with the connection details of the database or service before you attempt to configure rotation.
CloudformationResource: AWS::SecretsManager::RotationSchedule
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SecretsManager;
var cfnRotationSchedule = new CfnRotationSchedule(this, "MyCfnRotationSchedule", new CfnRotationScheduleProps {
SecretId = "secretId",
// the properties below are optional
HostedRotationLambda = new HostedRotationLambdaProperty {
RotationType = "rotationType",
// the properties below are optional
ExcludeCharacters = "excludeCharacters",
KmsKeyArn = "kmsKeyArn",
MasterSecretArn = "masterSecretArn",
MasterSecretKmsKeyArn = "masterSecretKmsKeyArn",
RotationLambdaName = "rotationLambdaName",
Runtime = "runtime",
SuperuserSecretArn = "superuserSecretArn",
SuperuserSecretKmsKeyArn = "superuserSecretKmsKeyArn",
VpcSecurityGroupIds = "vpcSecurityGroupIds",
VpcSubnetIds = "vpcSubnetIds"
},
RotateImmediatelyOnUpdate = false,
RotationLambdaArn = "rotationLambdaArn",
RotationRules = new RotationRulesProperty {
AutomaticallyAfterDays = 123,
Duration = "duration",
ScheduleExpression = "scheduleExpression"
}
});
Synopsis
Constructors
CfnRotationSchedule(Construct, String, ICfnRotationScheduleProps) | Create a new |
CfnRotationSchedule(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnRotationSchedule(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
HostedRotationLambda | Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates . To use a rotation function that already exists, specify |
RotateImmediatelyOnUpdate | Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. |
RotationLambdaArn | The ARN of an existing Lambda rotation function. |
RotationRules | A structure that defines the rotation configuration for this secret. |
SecretId | The ARN or name of the secret to rotate. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnRotationSchedule(Construct, String, ICfnRotationScheduleProps)
Create a new AWS::SecretsManager::RotationSchedule
.
public CfnRotationSchedule(Construct scope, string id, ICfnRotationScheduleProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnRotationScheduleProps
- resource properties.
CfnRotationSchedule(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnRotationSchedule(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnRotationSchedule(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnRotationSchedule(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
HostedRotationLambda
Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates . To use a rotation function that already exists, specify RotationLambdaARN
instead.
public virtual object HostedRotationLambda { get; set; }
Property Value
System.Object
Remarks
For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
RotateImmediatelyOnUpdate
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
public virtual object RotateImmediatelyOnUpdate { get; set; }
Property Value
System.Object
Remarks
The rotation schedule is defined in RotationRules
.
If you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the testSecret
step of the Lambda rotation function. The test creates an AWSPENDING
version of the secret and then removes it.
If you don't specify this value, then by default, Secrets Manager rotates the secret immediately.
Rotation is an asynchronous process. For more information, see How rotation works .
RotationLambdaArn
The ARN of an existing Lambda rotation function.
public virtual string RotationLambdaArn { get; set; }
Property Value
System.String
Remarks
To specify a rotation function that is also defined in this template, use the Ref function.
For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
To create a new rotation function based on one of the Secrets Manager rotation function templates , specify HostedRotationLambda
instead.
RotationRules
A structure that defines the rotation configuration for this secret.
public virtual object RotationRules { get; set; }
Property Value
System.Object
Remarks
SecretId
The ARN or name of the secret to rotate.
public virtual string SecretId { get; set; }
Property Value
System.String
Remarks
To reference a secret also created in this template, use the Ref function with the secret's logical ID.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>