Skip to main content

rotation_schedules

Creates, updates, deletes or gets a rotation_schedule resource or lists rotation_schedules in a region

Overview

Namerotation_schedules
TypeResource
DescriptionResource Type definition for AWS::SecretsManager::RotationSchedule
Idawscc.secretsmanager.rotation_schedules

Fields

NameDatatypeDescription
hosted_rotation_lambdaobjectCreates 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.
secret_idstringThe ARN or name of the secret to rotate.
idstringThe ARN of the secret.
rotate_immediately_on_updatebooleanSpecifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
rotation_lambda_arnstringThe ARN of an existing Lambda rotation function. To specify a rotation function that is also defined in this template, use the Ref function.
rotation_rulesobjectA structure that defines the rotation configuration for this secret.
regionstringAWS region.

For more information, see AWS::SecretsManager::RotationSchedule.

Methods

NameResourceAccessible byRequired Params
create_resourcerotation_schedulesINSERTSecretId, region
delete_resourcerotation_schedulesDELETEIdentifier, region
update_resourcerotation_schedulesUPDATEIdentifier, PatchDocument, region
list_resourcesrotation_schedules_list_onlySELECTregion
get_resourcerotation_schedulesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual rotation_schedule.

SELECT
region,
hosted_rotation_lambda,
secret_id,
id,
rotate_immediately_on_update,
rotation_lambda_arn,
rotation_rules
FROM awscc.secretsmanager.rotation_schedules
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

INSERT example

Use the following StackQL query and manifest file to create a new rotation_schedule resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.secretsmanager.rotation_schedules (
SecretId,
region
)
SELECT
'{{ secret_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a rotation_schedule resource, using stack-deploy.

/*+ update */
UPDATE awscc.secretsmanager.rotation_schedules
SET PatchDocument = string('{{ {
"HostedRotationLambda": hosted_rotation_lambda,
"RotateImmediatelyOnUpdate": rotate_immediately_on_update,
"RotationLambdaARN": rotation_lambda_arn,
"RotationRules": rotation_rules
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.secretsmanager.rotation_schedules
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the rotation_schedules resource, the following permissions are required:

secretsmanager:DescribeSecret