internet_gateway#
State module for managing EC2 Internet Gateways.
hub.exec.boto3.client.ec2.attach_internet_gateway hub.exec.boto3.client.ec2.create_internet_gateway hub.exec.boto3.client.ec2.delete_internet_gateway hub.exec.boto3.client.ec2.describe_internet_gateways hub.exec.boto3.client.ec2.detach_internet_gateway resource = await hub.tool.boto3.resource.create(ctx, “ec2”, “InternetGateway”, name) hub.tool.boto3.resource.exec(resource, attach_to_vpc, *args, **kwargs) hub.tool.boto3.resource.exec(resource, create_tags, *args, **kwargs)
- async idem_aws.states.aws.ec2.internet_gateway.present(hub, ctx, name: str, resource_id: str = None, tags: Dict[str, Any] = None, vpc_id: List = None) Dict[str, Any] [source]#
Creates an internet gateway for use with a VPC.
After creating the internet gateway, you attach it to a VPC using AttachInternetGateway. For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide.
- Parameters:
name (str) – An Idem name to identify the internet gateway resource.
resource_id (str, Optional) – AWS Internet Gateway ID.
tags (dict or list, Optional) –
Dict in the format of
{tag-key: tag-value}
or List of tags in the format of[{"Key": tag-key, "Value": tag-value}]
to associate with the internet gateway resource. Defaults to None.- (Key, Optional):
The key of the tag. Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.
- (Value, Optional):
The value of the tag. Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.
vpc_id (list, Optional) – This list can contain only single element. This is ID of VPC to which internet gateway attaches. If vpc_id is not passed, then attach/detach operation is ignored. If user passes empty list, then attached vpc is detached.
- Request Syntax:
[internet_gateway-name]: aws.ec2.internet_gateway.present: - vpc_id: - 'string' - tags: - Key: 'string' Value: 'string'
- Returns:
Dict[str, Any]
Examples
test-igw: aws.ec2.internet_gateway.present: - vpc_id: - vpc-d04fbf46 - tags: - Key: Name Value: test-igw
- async idem_aws.states.aws.ec2.internet_gateway.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any] [source]#
Deletes the specified internet gateway.
If resource is attached to VPC. then it is detached first and then deleted.
- Parameters:
- Request Syntax:
[internet_gateway-name]: aws.ec2.internet_gateway.absent: - name: 'string' - resource_id: 'string'
- Returns:
Dict[str, Any]
Examples
igw-test: aws.ec2.internet_gateway.absent: - name: igw-test - resource_id: '12345678'
- async idem_aws.states.aws.ec2.internet_gateway.describe(hub, ctx) Dict[str, Dict[str, Any]] [source]#
Describe the resource in a way that can be recreated/managed with the corresponding “present” function
Describes one or more of your internet gateways.
- Returns:
Dict[str, Any]
Examples
$ idem describe aws.ec2.internet_gateway