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 | awscc.apigateway.resources |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
parent_id | string | |
path_part | string | |
resource_id | string | |
rest_api_id | string | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
resource_id | string | |
rest_api_id | string | |
region | string | AWS region. |
For more information, see AWS::ApiGateway::Resource.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | resources | INSERT | ParentId, PathPart, RestApiId, region |
delete_resource | resources | DELETE | Identifier, region |
update_resource | resources | UPDATE | Identifier, PatchDocument, region |
list_resources | resources_list_only | SELECT | region |
get_resource | resources | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual resource.
SELECT
region,
parent_id,
path_part,
resource_id,
rest_api_id
FROM awscc.apigateway.resources
WHERE
region = 'us-east-1' AND
Identifier = '{{ rest_api_id }}|{{ resource_id }}';
Lists all resources in a region.
SELECT
region,
rest_api_id,
resource_id
FROM awscc.apigateway.resources_list_only
WHERE
region = 'us-east-1';
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 awscc.apigateway.resources (
ParentId,
PathPart,
RestApiId,
region
)
SELECT
'{{ parent_id }}',
'{{ path_part }}',
'{{ rest_api_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.apigateway.resources (
ParentId,
PathPart,
RestApiId,
region
)
SELECT
'{{ parent_id }}',
'{{ path_part }}',
'{{ rest_api_id }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: resource
props:
- name: parent_id
value: '{{ parent_id }}'
- name: path_part
value: '{{ path_part }}'
- name: rest_api_id
value: '{{ rest_api_id }}'
DELETE example
/*+ delete */
DELETE FROM awscc.apigateway.resources
WHERE
Identifier = '{{ rest_api_id }}|{{ resource_id }}' AND
region = 'us-east-1';
Permissions
To operate on the resources resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
apigateway:GET
apigateway:POST
apigateway:GET,
apigateway:PATCH
apigateway:GET
apigateway:DELETE