security_group_ingresses
Used to retrieve a list of security_group_ingresses
in a region or to create or delete a security_group_ingresses
resource, use security_group_ingress
to read or update an individual resource.
Overview
Name | security_group_ingresses |
Type | Resource |
Description | Resource Type definition for AWS::EC2::SecurityGroupIngress |
Id | aws.ec2.security_group_ingresses |
Fields
Name | Datatype | Description |
---|---|---|
id | string | The Security Group Rule Id |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | IpProtocol, region |
delete_resource | DELETE | data__Identifier, region |
list_resource | SELECT | region |
SELECT
Example
SELECT
region,
id
FROM aws.ec2.security_group_ingresses
WHERE region = 'us-east-1';
INSERT
Example
Use the following StackQL query and manifest file to create a new security_group_ingress
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.security_group_ingresses (
IpProtocol,
region
)
SELECT
'{{ IpProtocol }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.security_group_ingresses (
CidrIp,
CidrIpv6,
Description,
FromPort,
GroupId,
GroupName,
IpProtocol,
SourcePrefixListId,
SourceSecurityGroupId,
SourceSecurityGroupName,
SourceSecurityGroupOwnerId,
ToPort,
region
)
SELECT
'{{ CidrIp }}',
'{{ CidrIpv6 }}',
'{{ Description }}',
'{{ FromPort }}',
'{{ GroupId }}',
'{{ GroupName }}',
'{{ IpProtocol }}',
'{{ SourcePrefixListId }}',
'{{ SourceSecurityGroupId }}',
'{{ SourceSecurityGroupName }}',
'{{ SourceSecurityGroupOwnerId }}',
'{{ ToPort }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: security_group_ingress
props:
- name: CidrIp
value: '{{ CidrIp }}'
- name: CidrIpv6
value: '{{ CidrIpv6 }}'
- name: Description
value: '{{ Description }}'
- name: FromPort
value: '{{ FromPort }}'
- name: GroupId
value: '{{ GroupId }}'
- name: GroupName
value: '{{ GroupName }}'
- name: IpProtocol
value: '{{ IpProtocol }}'
- name: SourcePrefixListId
value: '{{ SourcePrefixListId }}'
- name: SourceSecurityGroupId
value: '{{ SourceSecurityGroupId }}'
- name: SourceSecurityGroupName
value: '{{ SourceSecurityGroupName }}'
- name: SourceSecurityGroupOwnerId
value: '{{ SourceSecurityGroupOwnerId }}'
- name: ToPort
value: '{{ ToPort }}'
DELETE
Example
/*+ delete */
DELETE FROM aws.ec2.security_group_ingresses
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';
Permissions
To operate on the security_group_ingresses
resource, the following permissions are required:
Create
ec2:DescribeSecurityGroupRules,
ec2:AuthorizeSecurityGroupIngress
Delete
ec2:DescribeSecurityGroupRules,
ec2:RevokeSecurityGroupIngress
List
ec2:DescribeSecurityGroupRules