ip_sets
Creates, updates, deletes or gets an ip_set resource or lists ip_sets in a region
Overview
| Name | ip_sets |
| Type | Resource |
| Description | Contains a list of IP addresses. This can be either IPV4 or IPV6. The list will be mutually |
| Id | awscc.wafv2.ip_sets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | |
description | string | Description of the entity. |
name | string | Name of the WebACL. |
id | string | Id of the WebACL |
scope | string | Use CLOUDFRONT for CloudFront WebACL, use REGIONAL for Application Load Balancer and API Gateway. |
ip_address_version | string | Type of addresses in the IPSet, use IPV4 for IPV4 IP addresses, IPV6 for IPV6 address. |
addresses | array | List of IPAddresses. |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the WebACL. |
id | string | Id of the WebACL |
scope | string | Use CLOUDFRONT for CloudFront WebACL, use REGIONAL for Application Load Balancer and API Gateway. |
region | string | AWS region. |
For more information, see AWS::WAFv2::IPSet.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | ip_sets | INSERT | Addresses, IPAddressVersion, Scope, region |
delete_resource | ip_sets | DELETE | Identifier, region |
update_resource | ip_sets | UPDATE | Identifier, PatchDocument, region |
list_resources | ip_sets_list_only | SELECT | region |
get_resource | ip_sets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual ip_set.
SELECT
region,
arn,
description,
name,
id,
scope,
ip_address_version,
addresses,
tags
FROM awscc.wafv2.ip_sets
WHERE
region = 'us-east-1' AND
Identifier = '{{ name }}|{{ id }}|{{ scope }}';
Lists all ip_sets in a region.
SELECT
region,
name,
id,
scope
FROM awscc.wafv2.ip_sets_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new ip_set resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.wafv2.ip_sets (
Scope,
IPAddressVersion,
Addresses,
region
)
SELECT
'{{ scope }}',
'{{ ip_address_version }}',
'{{ addresses }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.wafv2.ip_sets (
Description,
Name,
Scope,
IPAddressVersion,
Addresses,
Tags,
region
)
SELECT
'{{ description }}',
'{{ name }}',
'{{ scope }}',
'{{ ip_address_version }}',
'{{ addresses }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: ip_set
props:
- name: description
value: '{{ description }}'
- name: name
value: '{{ name }}'
- name: scope
value: '{{ scope }}'
- name: ip_address_version
value: '{{ ip_address_version }}'
- name: addresses
value:
- '{{ addresses[0] }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a ip_set resource, using stack-deploy.
/*+ update */
UPDATE awscc.wafv2.ip_sets
SET PatchDocument = string('{{ {
"Description": description,
"IPAddressVersion": ip_address_version,
"Addresses": addresses,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}|{{ id }}|{{ scope }}';
DELETE example
/*+ delete */
DELETE FROM awscc.wafv2.ip_sets
WHERE
Identifier = '{{ name }}|{{ id }}|{{ scope }}' AND
region = 'us-east-1';
Permissions
To operate on the ip_sets resource, the following permissions are required:
- Create
- Delete
- Read
- Update
- List
wafv2:CreateIPSet,
wafv2:GetIPSet,
wafv2:ListTagsForResource,
wafv2:TagResource,
wafv2:UntagResource
wafv2:DeleteIPSet,
wafv2:GetIPSet
wafv2:GetIPSet,
wafv2:ListTagsForResource
wafv2:UpdateIPSet,
wafv2:GetIPSet,
wafv2:ListTagsForResource,
wafv2:TagResource,
wafv2:UntagResource
wafv2:listIPSets