hwceco.hwcollection.hwc_vpc_security_group_rule – Creates a resource of Vpc/SecurityGroupRule in Huawei Cloud¶
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_security_group_rule
.
New in version 1.0.0: of hwceco.hwcollection
Requirements¶
The below requirements are needed on the host that executes this module.
huaweicloudsdkcore >= 3.0.47
huaweicloudsdkvpc >= 3.0.47
Parameters¶
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¶
# create a security group rule
- name: create a security group
hwc_vpc_security_group:
name: "ansible_network_security_group_test"
filters:
- "name"
register: sg
- name: create a security group rule
hwc_vpc_security_group_rule:
direction: "ingress"
protocol: "tcp"
ethertype: "IPv4"
port_range_max: 22
security_group_id: "{{ sg.state.id }}"
port_range_min: 22
filters:
- "security_group_id"
remote_ip_prefix: "0.0.0.0/0"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Huawei (@huaweicloud)