Skip to main content

resources

Creates, updates, deletes or gets a resource resource or lists resources in a region

Overview

Nameresources
TypeResource
DescriptionThe AWS::ApiGateway::Resource resource creates a resource in an API.
Idaws.apigateway.resources

Fields

NameDatatypeDescription
parent_idstringThe parent resource's identifier.
path_partstringThe last path segment for this resource.
resource_idstring
rest_api_idstringThe string identifier of the associated RestApi.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTParentId, PathPart, RestApiId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.apigateway.resources (
ParentId,
PathPart,
RestApiId,
region
)
SELECT
'{{ ParentId }}',
'{{ PathPart }}',
'{{ RestApiId }}',
'{{ region }}';

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