Skip to main content

secret_target_attachments

Creates, updates, deletes or gets a secret_target_attachment resource or lists secret_target_attachments in a region

Overview

Namesecret_target_attachments
TypeResource
DescriptionResource Type definition for AWS::SecretsManager::SecretTargetAttachment
Idaws.secretsmanager.secret_target_attachments

Fields

NameDatatypeDescription
idstring
secret_idstring
target_typestring
target_idstring
regionstringAWS region.

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

Methods

NameAccessible byRequired Params
create_resourceINSERTTargetType, TargetId, SecretId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all secret_target_attachments in a region.

SELECT
region,
id,
secret_id,
target_type,
target_id
FROM aws.secretsmanager.secret_target_attachments
WHERE region = 'us-east-1';

Gets all properties from an individual secret_target_attachment.

SELECT
region,
id,
secret_id,
target_type,
target_id
FROM aws.secretsmanager.secret_target_attachments
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';

INSERT example

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

/*+ create */
INSERT INTO aws.secretsmanager.secret_target_attachments (
SecretId,
TargetType,
TargetId,
region
)
SELECT
'{{ SecretId }}',
'{{ TargetType }}',
'{{ TargetId }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.secretsmanager.secret_target_attachments
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

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

Read

secretsmanager:GetSecretValue

List

secretsmanager:GetSecretValue,
secretsmanager:ListSecrets

Create

secretsmanager:GetSecretValue,
secretsmanager:PutSecretValue,
rds:DescribeDBInstances,
redshift:DescribeClusters,
rds:DescribeDBClusters,
docdb-elastic:GetCluster,
redshift-serverless:ListWorkgroups,
redshift-serverless:GetNamespace

Delete

secretsmanager:GetSecretValue,
secretsmanager:PutSecretValue

Update

secretsmanager:GetSecretValue,
secretsmanager:PutSecretValue,
rds:DescribeDBInstances,
redshift:DescribeClusters,
rds:DescribeDBClusters,
docdb-elastic:GetCluster,
redshift-serverless:ListWorkgroups,
redshift-serverless:GetNamespace