Created
August 28, 2025 12:49
-
-
Save infamousjoeg/725b5e921edb87f107dc6ea2c8623d0f to your computer and use it in GitHub Desktop.
Secrets Hub ListSecrets Only CloudFormation Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Parameters": { | |
"PolicyName": { | |
"Type": "String", | |
"Description": "Meaningful policy name" | |
}, | |
"CyberArkSecretsHubRoleARN": { | |
"Type": "String", | |
"Description": "The Secrets Hub tenant role ARN which will be trusted by this role" | |
}, | |
"SecretsManagerRegion": { | |
"Type": "String", | |
"Description": "The AWS Secrets Manager Account region that the Secrets Hub will have access to" | |
} | |
}, | |
"Resources": { | |
"AllowSecretsAccessRole": { | |
"Type": "AWS::IAM::Role", | |
"Properties": { | |
"AssumeRolePolicyDocument": { | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": { | |
"Ref": "CyberArkSecretsHubRoleARN" | |
} | |
}, | |
"Action": [ | |
"sts:AssumeRole" | |
] | |
} | |
] | |
}, | |
"Policies": [ | |
{ | |
"PolicyName": { | |
"Ref": "PolicyName" | |
}, | |
"PolicyDocument": { | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": "secretsmanager:ListSecrets", | |
"Resource": "*", | |
"Effect": "Allow", | |
"Condition": { | |
"StringEquals": { | |
"aws:RequestedRegion": { | |
"Ref": "SecretsManagerRegion" | |
} | |
} | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment