Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python configuration: resource name and name in property #449

Open
bbzg opened this issue May 9, 2019 · 1 comment
Open

Python configuration: resource name and name in property #449

bbzg opened this issue May 9, 2019 · 1 comment

Comments

@bbzg
Copy link

bbzg commented May 9, 2019

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!

@bohdanyurov-gl
Copy link

In general we use resource name for name and project from context as default project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants