Skip to content

Commit

Permalink
Update return block in documentation for ec2 modules (part 1) (#2072)
Browse files Browse the repository at this point in the history
Update return block in documentation for ec2 modules (part 1)

SUMMARY


Refer #1983
This PR aligns the RETURN blocks in the module documentation to accurately reflect what the module returns, ensuring consistency.
Modules updated:
ec2_eip_info, ec2_ami, ec2_ami_info, ec2_eni, ec2_eni_info, ec2_instance, ec2_instance_info, ec2_security_group, ec2_security_group_info
ISSUE TYPE


Docs Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis
Reviewed-by: Mark Chappell
Reviewed-by: Mike Graves <[email protected]>
  • Loading branch information
GomathiselviS authored May 7, 2024
1 parent 54d52c2 commit a519817
Show file tree
Hide file tree
Showing 10 changed files with 492 additions and 60 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/return_block_update_ec2_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- Update return block in the module documentation ec2_eip_info, ec2_ami, ec2_ami_info, ec2_eni, ec2_eni_info, ec2_instance, ec2_instance_info, ec2_security_group, ec2_security_group_info
43 changes: 43 additions & 0 deletions plugins/modules/ec2_ami.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@
returned: when AMI is created or already exists
type: str
sample: "nat-server"
enhanced_networking:
description: Specifies whether enhanced networking with ENA is enabled.
returned: when AMI is created or already exists
type: bool
sample: true
hypervisor:
description: Type of hypervisor.
returned: when AMI is created or already exists
Expand All @@ -349,11 +354,26 @@
returned: when AMI is created or already exists
type: str
sample: "ami-1234abcd"
image_owner_alias:
description: The owner alias ( amazon | aws-marketplace).
returned: when AMI is created or already exists
type: str
sample: "amazon"
image_type:
description: Type of image.
returned: when AMI is created or already exists
type: str
sample: "machine"
is_public:
description: Whether image is public.
returned: when AMI is created or already exists
type: bool
sample: false
kernel_id:
description: The kernel associated with the image, if any. Only applicable for machine images.
returned: when AMI is created or already exists
type: str
sample: "aki-88aa75e1"
launch_permission:
description: Permissions allowing other accounts to access the AMI.
returned: when AMI is created or already exists
Expand All @@ -379,6 +399,16 @@
description: Platform of image.
returned: when AMI is created or already exists
type: str
sample: "Windows"
product_codes:
description: Any product codes associated with the AMI.
returned: when AMI is created or already exists
type: list
sample: []
ramdisk_id:
description: The RAM disk associated with the image, if any. Only applicable for machine images.
returned: when AMI is created or already exists
type: str
sample: null
root_device_name:
description: Root device name of image.
Expand All @@ -390,11 +420,24 @@
returned: when AMI is created or already exists
type: str
sample: "ebs"
sriov_net_support:
description: Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
returned: when AMI is created or already exists
type: str
sample: "simple"
state:
description: State of image.
returned: when AMI is created or already exists
type: str
sample: "available"
state_reason:
description: The reason for the state change.
returned: when AMI is created or already exists
type: dict
sample: {
'Code': 'string',
'Message': 'string'
}
tags:
description: A dictionary of tags assigned to image.
returned: when AMI is created or already exists
Expand Down
12 changes: 10 additions & 2 deletions plugins/modules/ec2_ami_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
sample: '2017-10-16T19:22:13.000Z'
description:
description: The description of the AMI.
returned: always
type: str
sample: ''
ena_support:
Expand Down Expand Up @@ -163,6 +162,11 @@
returned: always
type: str
sample: '123456789012'
platform_details:
description: Platform of image.
returned: always
type: str
sample: "Windows"
public:
description: Whether the image has public launch permissions.
returned: always
Expand All @@ -180,7 +184,6 @@
sample: ebs
sriov_net_support:
description: Whether enhanced networking is enabled.
returned: always
type: str
sample: simple
state:
Expand All @@ -192,6 +195,11 @@
description: Any tags assigned to the image.
returned: always
type: dict
usage_operation:
description: The operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
returned: always
type: str
sample: "RunInstances"
virtualization_type:
description: The type of virtualization of the AMI.
returned: always
Expand Down
61 changes: 50 additions & 11 deletions plugins/modules/ec2_eip_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,58 @@
description: Properties of all Elastic IP addresses matching the provided filters. Each element is a dict with all the information related to an EIP.
returned: on success
type: list
sample: [{
"allocation_id": "eipalloc-64de1b01",
"association_id": "eipassoc-0fe9ce90d6e983e97",
"domain": "vpc",
"instance_id": "i-01020cfeb25b0c84f",
"network_interface_id": "eni-02fdeadfd4beef9323b",
"network_interface_owner_id": "0123456789",
"private_ip_address": "10.0.0.1",
"public_ip": "54.81.104.1",
"tags": {
elements: dict
contains:
"allocation_id":
description: The ID representing the allocation of the address.
returned: always
type: str
sample: "eipalloc-64de1b01"
"association_id":
description: The ID representing the association of the address with an instance.
type: str
sample: "eipassoc-0fe9ce90d6e983e97"
"domain":
description: The network ( vpc).
type: str
returned: always
sample: "vpc"
"instance_id":
description: The ID of the instance that the address is associated with (if any).
returned: if any instance is associated
type: str
sample: "i-01020cfeb25b0c84f"
"network_border_group":
description: The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.
returned: if any instance is associated
type: str
sample: "us-east-1"
"network_interface_id":
description: The ID of the network interface.
returned: if any instance is associated
type: str
sample: "eni-02fdeadfd4beef9323b"
"network_interface_owner_id":
description: The ID of the network interface.
returned: if any instance is associated
type: str
sample: "0123456789"
"private_ip_address":
description: The private IP address associated with the Elastic IP address.
returned: always
type: str
sample: "10.0.0.1"
"public_ip":
description: The Elastic IP address.
returned: if any instance is associated
type: str
sample: "54.81.104.1"
"tags":
description: Any tags assigned to the Elastic IP address.
type: dict
sample: {
"Name": "test-vm-54.81.104.1"
}
}]
"""

try:
Expand Down
18 changes: 14 additions & 4 deletions plugins/modules/ec2_eni.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,25 @@
returned: when state != absent
type: complex
contains:
attachment:
description: The network interface attachment.
type: dict
sample: {
"attach_time": "2024-04-25T20:57:20+00:00",
"attachment_id": "eni-attach-0ddce58b341a1846f",
"delete_on_termination": true,
"device_index": 0,
"instance_id": "i-032cb1cceb29250d2",
"status": "attached"
}
description:
description: interface description
type: str
sample: Firewall network interface
groups:
description: list of security groups
type: list
elements: dict
sample: [ { "sg-f8a8a9da": "default" } ]
description: dict of security groups
type: dict
sample: { "sg-f8a8a9da": "default" }
id:
description: network interface id
type: str
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_eni_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
device_index: 1,
instance_id: "i-15b8d3cadbafa1234",
instance_owner_id: "123456789012",
"network_card_index": 0,
status: "attached"
}
availability_zone:
Expand Down Expand Up @@ -147,7 +148,6 @@
sample: []
requester_id:
description: The ID of the entity that launched the ENI.
returned: always
type: str
sample: "AIDA12345EXAMPLE54321"
requester_managed:
Expand Down
Loading

0 comments on commit a519817

Please sign in to comment.