hwceco.hwcollection.hwc_vpc – Creates a Huawei Cloud VPC

Note

This plugin is part of the hwceco.hwcollection collection (version 1.0.5).

To install it use: ansible-galaxy collection install hwceco.hwcollection.

To use it in a playbook, specify: hwceco.hwcollection.hwc_vpc.

New in version 1.0.0: of hwceco.hwcollection

Synopsis

  • Creates and manages a Huawei Cloud VPC.

Requirements

The below requirements are needed on the host that executes this module.

  • huaweicloudsdkcore >= 3.0.47

  • huaweicloudsdkvpc >= 3.0.47

Parameters

Parameter Choices/Defaults Comments
access_key
string / required
Specifies the access key of the HuaweiCloud to use.
cidr
string / required
Specifies the range of available subnets in the vpc.
cloud
string
Default:
"myhuaweicloud.com"
Specifies the endpoint of the cloud. Required if you are using other cloud supported by Huaweicloud.
description
string
Specifies the description of the vpc.
enterprise_project_id
string
Specifies the enterprise project id of the vpc.
identity_endpoint
string
Default:
"https://iam.myhuaweicloud.com:443/v3"
Specifies the Identity authentication URL. Required if you are using other cloud supported by Huaweicloud.
name
string / required
Specifies the name of vpc.
project_id
string / required
Specifies the of ID of the project to login with.
region
string / required
Specifies the Huawei Cloud region.
secret_key
string / required
Specifies the secret key of the HuaweiCloud to use.
state
string
    Choices:
  • present ←
  • absent
Whether the given object should exist in Huawei Cloud.
tags
dictionary
Specifies the key/value pairs to associate with the vpc.

Notes

Note

  • For authentication, you can set access_key using the `ANSIBLE_HWC_ACCESS_KEY’ env variable.

  • For authentication, you can set secret_key using the `ANSIBLE_HWC_SECRET_KEY’ env variable.

  • For authentication, you can set project_id using the `ANSIBLE_HWC_PROJECT_ID’ env variable.

  • For authentication, you can set region using the `ANSIBLE_HWC_REGION’ env variable.

  • For authentication, you can set identity_endpoint using the `ANSIBLE_HWC_IDENTITY_ENDPOINT’ env variable.

  • For authentication, you can set cloud using the `ANSIBLE_HWC_CLOUD’ env variable.

  • Environment variables values will only be used if the playbook values are not set.

Examples

- name: create a vpc
  hwc_vpc:
      name: "vpc_1"
      cidr: "192.168.100.0/24"
      state: present

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
cidr
string
success
the range of available subnets in the vpc.

description
string
success
Specifies the description of the vpc.

enterprise_project_id
string
success
Specifies the enterprise project id of the vpc.

id
string
success
the id of vpc.

name
string
success
the name of vpc.

routes
dictionary
success
the route information.

 
destination
string
success
the destination network segment of a route.

 
next_hop
string
success
the next hop of a route.

status
string
success
the status of vpc.



Authors

  • Huawei (@huaweicloud)