GoogleCloudPlatform / GoogleCloudPlatform/deploymentmanager-samples
Python configuration: resource name and name in property
- Dominant language
- Jinja
- Stars
- 951
- Forks
- 700
- PR merge metrics
- No merged PRs in 30d
Description
I have tried to dig into the documentation, but I can't find any good answer there.
What I want to know is, when is `name` in a resource's `properties` required?
From what I can gather from the examples, the name of the resource is automatically injected as the `name` property as well?
For example, a `compute.v1.address` has a `name` property, and it gets set to the resource name, if it's omitted.
```
def generate_config(context):
address = {
'name': context.env['name'],
'type': 'compute.v1.address',
'properties': {
'region': context.properties['region'],
'description': context.properties['description']
}
}
return {'resources': [address]}
```
Are there other properties that behave this way? A few lines about this behavior would be nice to have in the documentation.
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.