Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . ec2 . wait ]

security-group-exists

Description

Wait until JMESPath query length(SecurityGroups[].GroupId) > 0 returns True when polling with describe-security-groups. It will poll every 5 seconds until a successful state has been reached. This will exit with a return code of 255 after 6 failed checks.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

security-group-exists is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the --no-paginate argument. When using --output text and the --query argument on a paginated response, the --query argument must extract data from the results of the following query expressions: SecurityGroups

Synopsis

  security-group-exists
[--filters <value>]
[--group-ids <value>]
[--group-names <value>]
[--dry-run | --no-dry-run]
[--cli-input-json <value>]
[--starting-token <value>]
[--page-size <value>]
[--max-items <value>]
[--generate-cli-skeleton <value>]

Options

--filters (list)

The filters. If using multiple filters for rules, the results include security groups for which any combination of rules - not necessarily a single rule - match all filters.

  • description - The description of the security group.
  • egress.ip-permission.cidr - An IPv4 CIDR block for an outbound security group rule.
  • egress.ip-permission.from-port - For an outbound rule, the start of port range for the TCP and UDP protocols, or an ICMP type number.
  • egress.ip-permission.group-id - The ID of a security group that has been referenced in an outbound security group rule.
  • egress.ip-permission.group-name - The name of a security group that has been referenced in an outbound security group rule.
  • egress.ip-permission.ipv6-cidr - An IPv6 CIDR block for an outbound security group rule.
  • egress.ip-permission.prefix-list-id - The ID (prefix) of the AWS service to which a security group rule allows outbound access.
  • egress.ip-permission.protocol - The IP protocol for an outbound security group rule (tcp | udp | icmp or a protocol number).
  • egress.ip-permission.to-port - For an outbound rule, the end of port range for the TCP and UDP protocols, or an ICMP code.
  • egress.ip-permission.user-id - The ID of an AWS account that has been referenced in an outbound security group rule.
  • group-id - The ID of the security group.
  • group-name - The name of the security group.
  • ip-permission.cidr - An IPv4 CIDR block for an inbound security group rule.
  • ip-permission.from-port - For an inbound rule, the start of port range for the TCP and UDP protocols, or an ICMP type number.
  • ip-permission.group-id - The ID of a security group that has been referenced in an inbound security group rule.
  • ip-permission.group-name - The name of a security group that has been referenced in an inbound security group rule.
  • ip-permission.ipv6-cidr - An IPv6 CIDR block for an inbound security group rule.
  • ip-permission.prefix-list-id - The ID (prefix) of the AWS service from which a security group rule allows inbound access.
  • ip-permission.protocol - The IP protocol for an inbound security group rule (tcp | udp | icmp or a protocol number).
  • ip-permission.to-port - For an inbound rule, the end of port range for the TCP and UDP protocols, or an ICMP code.
  • ip-permission.user-id - The ID of an AWS account that has been referenced in an inbound security group rule.
  • owner-id - The AWS account ID of the owner of the security group.
  • tag :key- The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA , specify tag:Owner for the filter name and TeamA for the filter value.
  • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.
  • vpc-id - The ID of the VPC specified when the security group was created.

Shorthand Syntax:

Name=string,Values=string,string ...

JSON Syntax:

[
  {
    "Name": "string",
    "Values": ["string", ...]
  }
  ...
]

--group-ids (list)

The IDs of the security groups. Required for security groups in a nondefault VPC.

Default: Describes all your security groups.

Syntax:

"string" "string" ...

--group-names (list)

[EC2-Classic and default VPC only] The names of the security groups. You can specify either the security group name or the security group ID. For security groups in a nondefault VPC, use the group-name filter to describe security groups by name.

Default: Describes all your security groups.

Syntax:

"string" "string" ...

--dry-run | --no-dry-run (boolean)

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--starting-token (string)

A token to specify where to start paginating. This is the NextToken from a previously truncated response.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--page-size (integer)

The size of each page to get in the AWS service call. This does not affect the number of items returned in the command's output. Setting a smaller page size results in more calls to the AWS service, retrieving fewer items in each call. This can help prevent the AWS service calls from timing out.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--max-items (integer)

The total number of items to return in the command's output. If the total number of items available is more than the value specified, a NextToken is provided in the command's output. To resume pagination, provide the NextToken value in the starting-token argument of a subsequent command. Do not use the NextToken response element directly outside of the AWS CLI.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

To pause running until a security group exists

The following wait security-group-exists example pauses and continues only after it can confirm that the specified security group exists.

aws ec2 wait security-group-exists \
    --group-ids sg-07e789d0fb10492ee

This command produces no output.

Output

None