resource#

State module for managing Amazon API Gateway Resources.

async idem_aws.states.aws.apigateway.resource.present(hub, ctx, name: str, rest_api_id: str, parent_id: str, path_part: str, resource_id: str = None) Dict[str, Any][source]#

Creates a new resource or modifies an existing one.

Parameters:
  • name (str) – An idem name of the resource.

  • rest_api_id (str) – AWS rest_api id of the associated RestApi.

  • parent_id (str) – The parent resource’s id.

  • path_part (str) – The last path segment for this resource.

  • resource_id (str, Optional) – AWS Resource id. Defaults to None.

Returns:

dict[str, Any]

Examples

idem_test_aws_apigateway_resource:
  aws.apigateway.resource.present:
    - name: test_resource
    - rest_api_id: ${aws.apigateway.rest_api:test_rest_api:resource_id}
    - parent_id: ${aws.apigateway.rest_api:test_rest_api:root_resource_id}
    - path_part: 'stack'

idem_test_aws_apigateway_rest_api:
  aws.apigateway.rest_api.present:
    - name: test_rest_api

Note that either idem_test_aws_apigateway_rest_api or test_rest_api can be used in the reference; ${aws.apigateway.rest_api:idem_test_aws_apigateway_rest_api:resource_id} would work above.

[idem_test_aws_apigateway_resource]:
  aws.apigateway.resource.present:
    - name: 'string'
    - rest_api_id: 'string'
    - parent_id: 'string'
    - path_part: 'string'
async idem_aws.states.aws.apigateway.resource.absent(hub, ctx, name: str, rest_api_id: str = None, resource_id: str = None) Dict[str, Any][source]#

Deletes the specified resource.

Parameters:
  • name (str) – The Idem name of the resource.

  • rest_api_id (str, Optional) – AWS rest_api id of the associated RestApi.

  • resource_id (str, Optional) – AWS Resource id. Defaults to None.

Returns:

dict[str, Any]

Examples

resource_is_absent:
  aws.apigateway.resource.absent:
    - name: value
    - resource_id: value
    - rest_api_id: value
async idem_aws.states.aws.apigateway.resource.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the API Gateway Resources associated with a specific Rest API.

Returns a list of apigateway.resource descriptions

Returns:

dict[str, Any]

Examples

$ idem describe aws.apigateway.resource