1 Answer
- Newest
- Most votes
- Most comments
2
In CloudFormation, you can reference the properties of one resource within another, but directly referencing a property like you want (e.g., SomeResource.Properties.Name) is not straightforward because CloudFormation does not support direct references to a property value. However, you can work around this by using parameters or mappings if the value is known upfront, or by using outputs and intrinsic functions like !Ref or !Sub to achieve similar functionality.
- Parameters are useful for reusing values across multiple resources within the same template or across different templates.
- Mappings are useful when you have a set of predefined values that you need to use.
- Outputs and Cross-Stack References are useful for sharing values between different CloudFormation stacks.
- Substitution with !Sub allows you to reuse values within the same stack if they are static or generated dynamically at deployment time.
Resources:
SomeResource:
Type: 'AWS::Something'
Properties:
Name: 'MyName'
AnotherResource:
Type: 'AWS::AnotherThing'
Properties:
Name: !Sub '${SomeResourceName}'
Relevant content
- asked 3 years ago

Thank you. In your example, where does
SomeResourceNamedefined?