amazon.aws.ec2_vpc_egress_igw_info 模块 – 收集关于 AWS VPC 出口专用 Internet 网关的信息
注意
此模块是 amazon.aws 集合(版本 9.0.0)的一部分。
如果您正在使用 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install amazon.aws
。您需要其他要求才能使用此模块,请参阅 要求了解详细信息。
要在 Playbook 中使用它,请指定:amazon.aws.ec2_vpc_egress_igw_info
。
amazon.aws 9.0.0 中的新增功能
概要
收集关于 AWS VPC 出口专用 Internet 网关的信息。
要求
执行此模块的主机需要满足以下要求。
python >= 3.6
boto3 >= 1.28.0
botocore >= 1.31.0
参数
参数 |
注释 |
---|---|
AWS 访问密钥 ID。 有关访问令牌的更多信息,请参阅 AWS 文档 https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys。 也可以使用 aws_access_key 和 profile 选项互斥。 为了与 AWS botocore SDK 保持一致,在 5.1.0 版本中添加了 aws_access_key_id 别名。 ec2_access_key 别名已弃用,将在 2024-12-01 之后的版本中删除。 对 |
|
用于验证 SSL 证书的 CA 捆绑包的位置。 也可以使用 |
|
用于修改 botocore 配置的字典。 可以在 AWS 文档中找到参数 https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config。 |
|
使用 也可以使用 选择
|
|
获取特定 VPC 出口 Internet 网关 ID 的详细信息。 |
|
连接到而不是默认 AWS 终端节点的 URL。虽然这可以用于连接到其他与 AWS 兼容的服务,但 amazon.aws 和 community.aws 集合仅针对 AWS 进行测试。 也可以使用 ec2_url 和 s3_url 别名已弃用,将在 2024-12-01 之后的版本中删除。 对 |
|
要应用的过滤器字典。每个字典项包含一个过滤器键和一个过滤器值。有关可能的过滤器,请参阅 https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeEgressOnlyInternetGateways.html。 默认: |
|
用于身份验证的已命名的 AWS 配置文件。 有关已命名配置文件的更多信息,请参阅 AWS 文档 https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html。 也可以使用 profile 选项与 aws_access_key、aws_secret_key 和 security_token 选项互斥。 |
|
要使用的 AWS 区域。 对于诸如 IAM、Route53 和 CloudFront 等全局服务,将忽略 region。 也可以使用 有关更多信息,请参阅 Amazon AWS 文档 http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region。
对 |
|
AWS secret access key。 有关访问令牌的更多信息,请参阅 AWS 文档 https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys。 也可以按优先级降序使用 secret_key 和 profile 选项互斥。 为了与 AWS botocore SDK 保持一致,在 5.1.0 版本中添加了 aws_secret_access_key 别名。 ec2_secret_key 别名已被弃用,将在 2024-12-01 之后的版本中删除。 对 |
|
用于临时凭证的 AWS STS 会话令牌。 有关访问令牌的更多信息,请参阅 AWS 文档 https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys。 也可以按优先级降序使用 security_token 和 profile 选项互斥。 在 3.2.0 版本中添加了别名 aws_session_token 和 session_token,并在 6.0.0 版本中将参数名称从 security_token 重命名为 session_token。 security_token、aws_security_token 和 access_token 别名已被弃用,将在 2024-12-01 之后的版本中删除。 对 |
|
设置为 强烈建议不要设置 validate_certs=false,作为替代方案,请考虑设置 aws_ca_bundle。 选择
|
注释
注意
注意: 对于模块,环境变量和配置文件是从 Ansible “主机” 上下文而不是 “控制器” 上下文读取的。因此,可能需要将文件显式复制到 “主机”。对于查找和连接插件,环境变量和配置文件是从 Ansible “控制器” 上下文而不是 “主机” 上下文读取的。
Ansible 使用的 AWS SDK (boto3) 也可能会从其在 Ansible “主机” 上下文中的配置文件(通常是
~/.aws/credentials
)中读取凭据和其他设置(如区域)的默认值。有关更多信息,请参阅 https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html。
示例
# # Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Gather information about all VPC Egress only Internet Gateways for an account or profile
amazon.aws.ec2_vpc_igw_info:
region: ap-southeast-2
profile: production
- name: Gather information about a filtered list of VPC Egress only Internet Gateways
amazon.aws.ec2_vpc_igw_info:
region: ap-southeast-2
profile: production
filters:
"tag:Name": "igw-123"
- name: Gather information about a specific VPC egress only internet gateway by EgressOnlyInternetGatewayId
amazon.aws.ec2_vpc_igw_info:
region: ap-southeast-2
profile: production
egress_only_internet_gateway_ids: igw-c1231234
返回值
常见的返回值记录在 这里,以下是此模块特有的字段
键 |
描述 |
---|---|
AWS 仅出口互联网网关。 返回: 总是 |
|
有关仅出口互联网网关的附件的信息。 返回: 总是 |
|
附件的当前状态。 返回: 总是 示例: |
|
VPC 的 ID。 返回: 总是 示例: |
|
仅出口互联网网关的 ID。 返回: 总是 示例: |
|
分配给仅出口互联网网关的任何标签。 返回: 总是 |