Get proprety of an external resource

asked 2019-12-02 10:17:24 -0500

Cheos96 gravatar image

Hi everybody, First, i use newton version.

I find a difficulty to extract a property ( CIDR ) of an external resource ( Subnet ) using the 'external_id' block. Here is my code :

_subnet_cidr:
        type: OS::Neutron::Subnet
        external_id:
            get_param: p_subnet

When i launch my template, i get an error :

Failed to validate: resources[0]: Failed to validate: Failed to validate: resources[0]: Property network not assigned

If i try to add properties, it acts like creating a new resource, what i want is just import it and use it in my output section to get the attributes.

If nothing works i will use my env file to put cidr as input.

edit retag flag offensive close merge delete

Comments

did u tried cidr: get_param: cidr

piyushsrivastava gravatar imagepiyushsrivastava ( 2019-12-02 12:56:27 -0500 )edit

cidr isn't in my parameters section, i want to import a ressource and use it's properties in another resource, like:

get_attr: 
    - subnet_cidr
    - cidr

I can import Neutron::Net but doesnt work with Neutron::Subnet, it requiers a network as propertie.

Cheos96 gravatar imageCheos96 ( 2019-12-02 14:17:37 -0500 )edit

Do you have heat_template_version as newton or 2016-10-14 in your template? That is required to use external_id.

zaneb gravatar imagezaneb ( 2019-12-02 15:17:33 -0500 )edit

_net: type: OS::Neutron::Net external_id: get_param: - p_net - get_param: p_index _subnet: type: OS::Neutron::Subnet external_id: get_attr: - _net - subnets - 0

Cheos96 gravatar imageCheos96 ( 2019-12-03 03:42:52 -0500 )edit

i use newton version but still when i switched to 2016-10-14 i got the same error : Property network not assigned. looks like it can import Neutron::Net but not Neutron::Subnet ( Network is a required property to Neutron::Subnet )

Cheos96 gravatar imageCheos96 ( 2019-12-03 04:33:42 -0500 )edit