rotation_schedules
Creates, updates, deletes or gets a rotation_schedule resource or lists rotation_schedules in a region
Overview
| Name | rotation_schedules |
| Type | Resource |
| Description | Resource Type definition for AWS::SecretsManager::RotationSchedule |
| Id | awscc.secretsmanager.rotation_schedules |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
hosted_rotation_lambda | object | 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. |
secret_id | string | The ARN or name of the secret to rotate. |
id | string | The ARN of the secret. |
rotate_immediately_on_update | boolean | Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. |
rotation_lambda_arn | string | The ARN of an existing Lambda rotation function. To specify a rotation function that is also defined in this template, use the Ref function. |
rotation_rules | object | A structure that defines the rotation configuration for this secret. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ARN of the secret. |
region | string | AWS region. |
For more information, see AWS::SecretsManager::RotationSchedule.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | rotation_schedules | INSERT | SecretId, region |
delete_resource | rotation_schedules | DELETE | Identifier, region |
update_resource | rotation_schedules | UPDATE | Identifier, PatchDocument, region |
list_resources | rotation_schedules_list_only | SELECT | region |
get_resource | rotation_schedules | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all rotation_schedules in a region.
SELECT
region,
id
FROM awscc.secretsmanager.rotation_schedules_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new rotation_schedule resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.secretsmanager.rotation_schedules (
SecretId,
region
)
SELECT
'{{ secret_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.secretsmanager.rotation_schedules (
HostedRotationLambda,
SecretId,
RotateImmediatelyOnUpdate,
RotationLambdaARN,
RotationRules,
region
)
SELECT
'{{ hosted_rotation_lambda }}',
'{{ secret_id }}',
'{{ rotate_immediately_on_update }}',
'{{ rotation_lambda_arn }}',
'{{ rotation_rules }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: rotation_schedule
props:
- name: hosted_rotation_lambda
value:
runtime: '{{ runtime }}'
kms_key_arn: '{{ kms_key_arn }}'
master_secret_arn: '{{ master_secret_arn }}'
rotation_lambda_name: '{{ rotation_lambda_name }}'
rotation_type: '{{ rotation_type }}'
exclude_characters: '{{ exclude_characters }}'
vpc_security_group_ids: '{{ vpc_security_group_ids }}'
master_secret_kms_key_arn: '{{ master_secret_kms_key_arn }}'
superuser_secret_arn: '{{ superuser_secret_arn }}'
superuser_secret_kms_key_arn: '{{ superuser_secret_kms_key_arn }}'
vpc_subnet_ids: '{{ vpc_subnet_ids }}'
- name: secret_id
value: '{{ secret_id }}'
- name: rotate_immediately_on_update
value: '{{ rotate_immediately_on_update }}'
- name: rotation_lambda_arn
value: '{{ rotation_lambda_arn }}'
- name: rotation_rules
value:
schedule_expression: '{{ schedule_expression }}'
duration: '{{ duration }}'
automatically_after_days: '{{ automatically_after_days }}'
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.secretsmanager.rotation_schedules
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';
Permissions
To operate on the rotation_schedules resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
secretsmanager:DescribeSecret
secretsmanager:RotateSecret,
secretsmanager:DescribeSecret,
lambda:InvokeFunction
secretsmanager:RotateSecret,
secretsmanager:DescribeSecret,
lambda:InvokeFunction
secretsmanager:DescribeSecret,
secretsmanager:ListSecrets
secretsmanager:CancelRotateSecret,
secretsmanager:DescribeSecret