Skip to main content

security_groups_for_vpcs

Creates, updates, deletes, gets or lists a security_groups_for_vpcs resource.

Overview

Namesecurity_groups_for_vpcs
TypeResource
Idaws.ec2.security_groups_for_vpcs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringThe security group's description.
group_idstringThe security group ID.
group_namestringThe security group name.
owner_idstringThe security group owner ID.
primary_vpc_idstringThe VPC ID in which the security group was created.
tagsstringThe security group tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_security_groups_for_vpcselectVpcId, regionNextToken, MaxResults, Filter, DryRunGets security groups that can be associated by the Amazon Web Services account making the request with network interfaces in the specified VPC.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
VpcIdstringThe VPC ID where the security group can be used.
regionstringAWS region (default: us-east-1)
DryRunbooleanChecks 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.
FilterarrayThe filters. If using multiple filters, the results include security groups which match all filters. group-id: The security group ID. description: The security group's description. group-name: The security group name. owner-id: The security group owner ID. primary-vpc-id: The VPC ID in which the security group was created.
MaxResultsintegerThe maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.
NextTokenstringThe token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

SELECT examples

Gets security groups that can be associated by the Amazon Web Services account making the request with network interfaces in the specified VPC.

SELECT
description,
group_id,
group_name,
owner_id,
primary_vpc_id,
tags
FROM aws.ec2.security_groups_for_vpcs
WHERE VpcId = '{{ VpcId }}' -- required
AND region = '{{ region }}' -- required
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
AND Filter = '{{ Filter }}'
AND DryRun = '{{ DryRun }}'
;