secret_target_attachments
Creates, updates, deletes or gets a secret_target_attachment resource or lists secret_target_attachments in a region
Overview
| Name | secret_target_attachments |
| Type | Resource |
| Description | Resource Type definition for AWS::SecretsManager::SecretTargetAttachment |
| Id | awscc.secretsmanager.secret_target_attachments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | |
secret_id | string | |
target_type | string | |
target_id | string | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | |
region | string | AWS region. |
For more information, see AWS::SecretsManager::SecretTargetAttachment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | secret_target_attachments | INSERT | TargetType, TargetId, SecretId, region |
delete_resource | secret_target_attachments | DELETE | Identifier, region |
update_resource | secret_target_attachments | UPDATE | Identifier, PatchDocument, region |
list_resources | secret_target_attachments_list_only | SELECT | region |
get_resource | secret_target_attachments | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual secret_target_attachment.
SELECT
region,
id,
secret_id,
target_type,
target_id
FROM awscc.secretsmanager.secret_target_attachments
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all secret_target_attachments in a region.
SELECT
region,
id
FROM awscc.secretsmanager.secret_target_attachments_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new secret_target_attachment resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.secretsmanager.secret_target_attachments (
SecretId,
TargetType,
TargetId,
region
)
SELECT
'{{ secret_id }}',
'{{ target_type }}',
'{{ target_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.secretsmanager.secret_target_attachments (
SecretId,
TargetType,
TargetId,
region
)
SELECT
'{{ secret_id }}',
'{{ target_type }}',
'{{ target_id }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: secret_target_attachment
props:
- name: secret_id
value: '{{ secret_id }}'
- name: target_type
value: '{{ target_type }}'
- name: target_id
value: '{{ target_id }}'
UPDATE example
Use the following StackQL query and manifest file to update a secret_target_attachment resource, using stack-deploy.
/*+ update */
UPDATE awscc.secretsmanager.secret_target_attachments
SET PatchDocument = string('{{ {
"TargetType": target_type,
"TargetId": target_id
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.secretsmanager.secret_target_attachments
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';
Permissions
To operate on the secret_target_attachments resource, the following permissions are required:
- Read
- List
- Create
- Delete
- Update
secretsmanager:GetSecretValue
secretsmanager:GetSecretValue,
secretsmanager:ListSecrets
secretsmanager:GetSecretValue,
secretsmanager:PutSecretValue,
rds:DescribeDBInstances,
redshift:DescribeClusters,
rds:DescribeDBClusters,
docdb-elastic:GetCluster,
redshift-serverless:ListWorkgroups,
redshift-serverless:GetNamespace
secretsmanager:GetSecretValue,
secretsmanager:PutSecretValue
secretsmanager:GetSecretValue,
secretsmanager:PutSecretValue,
rds:DescribeDBInstances,
redshift:DescribeClusters,
rds:DescribeDBClusters,
docdb-elastic:GetCluster,
redshift-serverless:ListWorkgroups,
redshift-serverless:GetNamespace