CmdID

CmdID / aws / aws secretsmanager

aws secretsmanager get-resource-policy

Retrieves the JSON text of the resource-based policy document attached to the secret. AWS CLI reference

1 example 1 option Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

To retrieve the resource-based policy attached to a secret

The following get-resource-policy example retrieves the resource-based policy attached to a secret.

aws secretsmanager get-resource-policy --secret-id MyTestSecretIdentify
--secret-idThe ARN or name of the secret to retrieve the attached resource-based policy for.
Its output
{
    "ARN": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestSecret-a1b2c3",
    "Name": "MyTestSecret",
    "ResourcePolicy": "{\n\"Version\":\"2012-10-17\",\n\"Statement\":[{\n\"Effect\":\"Allow\",\n\"Principal\":{\n\"AWS\":\"arn:aws:iam::123456789012:root\"\n},\n\"Action\":\"secretsmanager:GetSecretValue\",\n\"Resource\":\"*\"\n}]\n}"
}

For more information, see Authentication and access control in the Secrets Manager User Guide.

Options

1 in the AWS CLI reference
--secret-idThe ARN or name of the secret to retrieve the attached resource-based policy for.