1 Answer
- Newest
- Most votes
- Most comments
0
Hi, @nemy.
How would you like to use existing secrets?
If you want to refer to another resource, use the resource's ARN or ID.
When referencing resources in CloudFormation, parameters are simply obtained and used according to the specification of each resource.
For example, AWS::SecretsManager::Secret will get the ARN by "Ref".
By using a custom function, I think that it is possible to create something that obtains an ARN string from a resource name that is not managed by the stack.
If you want to manage it as a CloudFormation stack, consider incorporating existing resources into the CloudFormation stack by referring to the following.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html
Relevant content
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Thank you for the answer.
How can I define a resource in the template by using ARN of an existing resource? What I want to do is something like below.
''' MyBucket: "ARN of the existing bucket"
MyPipeline: Type: AWS::CodePipeline::Pipeline Properties: RoleArn: !GetAtt CodePipelineRole.Arn Name: my-pipeline ArtifactStore: Type: S3 Location: !Ref MyBucket '''
If I simply write ARN instead of "!Ref MyBucket", I get the following error.
''' 1 validation error detected: Value at 'pipeline.artifactStore.location' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9-.]+ (Service: AWSCodePipeline; Status Code: 400; Error Code: ValidationException; '''.