resources
Creates, updates, deletes or gets a resource resource or lists resources in a region
Overview
| Name | resources |
| Type | Resource |
| Description | The AWS::ApiGateway::Resource resource creates a resource in an API. |
| Id | aws.apigateway.resources |
Fields
| Name | Datatype | Description |
|---|---|---|
parent_id | string | |
path_part | string | |
resource_id | string | |
rest_api_id | string | |
region | string | AWS region. |
For more information, see AWS::ApiGateway::Resource.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | ParentId, PathPart, RestApiId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT examples
Gets all resources in a region.
SELECT
region,
parent_id,
path_part,
resource_id,
rest_api_id
FROM aws.apigateway.resources
WHERE region = 'us-east-1';
Gets all properties from an individual resource.
SELECT
region,
parent_id,
path_part,
resource_id,
rest_api_id
FROM aws.apigateway.resources
WHERE region = 'us-east-1' AND data__Identifier = '<RestApiId>|<ResourceId>';
INSERT example
Use the following StackQL query and manifest file to create a new resource resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.apigateway.resources (
ParentId,
PathPart,
RestApiId,
region
)
SELECT
'{{ ParentId }}',
'{{ PathPart }}',
'{{ RestApiId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.apigateway.resources (
ParentId,
PathPart,
RestApiId,
region
)
SELECT
'{{ ParentId }}',
'{{ PathPart }}',
'{{ RestApiId }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: resource
props:
- name: ParentId
value: '{{ ParentId }}'
- name: PathPart
value: '{{ PathPart }}'
- name: RestApiId
value: '{{ RestApiId }}'
DELETE example
/*+ delete */
DELETE FROM aws.apigateway.resources
WHERE data__Identifier = '<RestApiId|ResourceId>'
AND region = 'us-east-1';
Permissions
To operate on the resources resource, the following permissions are required:
Read
apigateway:GET
Create
apigateway:POST
Update
apigateway:GET,
apigateway:PATCH
List
apigateway:GET
Delete
apigateway:DELETE