UNPKG

cdk-iam-floyd

Version:

AWS IAM policy statement generator with fluent interface for AWS CDK

1,025 lines 252 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApigatewayV2 = void 0; const shared_1 = require("../../shared"); /** * Statement provider for service [apigateway-v2](https://docs.aws.amazon.com/service-authorization/latest/reference/list_apigatewayv2.html). * * @param sid [SID](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html) of the statement */ class ApigatewayV2 extends shared_1.PolicyStatement { /** * Grants permission to create a Portal * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portals.html#portalspost */ toCreatePortal() { return this.to('CreatePortal'); } /** * Grants permission to create a Portal Product * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts.html#portalproductspost */ toCreatePortalProduct() { return this.to('CreatePortalProduct'); } /** * Grants permission to create a Product Page * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productpages.html#portalproducts-portalproductid-productpagespost */ toCreateProductPage() { return this.to('CreateProductPage'); } /** * Grants permission to create a Product REST Endpoint Page * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productrestendpointpages.html#portalproducts-portalproductid-productrestendpointpagespost */ toCreateProductRestEndpointPage() { return this.to('CreateProductRestEndpointPage'); } /** * Grants permission to create a routing rule * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/domainnames-domainname-routingrules.html#domainnames-domainname-routingrulespost */ toCreateRoutingRule() { return this.to('CreateRoutingRule'); } /** * Grants permission to delete a particular resource * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/api-reference.html */ toDELETE() { return this.to('DELETE'); } /** * Grants permission to delete a Portal * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portals-portalid.html#portals-portaliddelete */ toDeletePortal() { return this.to('DeletePortal'); } /** * Grants permission to delete a Portal Product * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid.html#portalproducts-portalproductiddelete */ toDeletePortalProduct() { return this.to('DeletePortalProduct'); } /** * Grants permission to delete a Portal Product Sharing Policy * * Access Level: Permissions management, Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-sharingpolicy.html#portalproducts-portalproductid-sharingpolicydelete */ toDeletePortalProductSharingPolicy() { return this.to('DeletePortalProductSharingPolicy'); } /** * Grants permission to delete a Product Page * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productpages-productpageid.html#portalproducts-portalproductid-productpages-productpageiddelete */ toDeleteProductPage() { return this.to('DeleteProductPage'); } /** * Grants permission to delete a Product REST Endpoint Page * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productrestendpointpages-productrestendpointpageid.html#portalproducts-portalproductid-productrestendpointpages-productrestendpointpageiddelete */ toDeleteProductRestEndpointPage() { return this.to('DeleteProductRestEndpointPage'); } /** * Grants permission to delete a routing rule * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/domainnames-domainname-routingrules-routingruleid.html#domainnames-domainname-routingrules-routingruleiddelete */ toDeleteRoutingRule() { return this.to('DeleteRoutingRule'); } /** * Grants permission to disable a Portal * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portals-portalid-publish.html#portals-portalid-publishdelete */ toDisablePortal() { return this.to('DisablePortal'); } /** * Grants permission to read a particular resource * * Access Level: Read * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/api-reference.html */ toGET() { return this.to('GET'); } /** * Grants permission to read a Portal * * Access Level: Read * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portals-portalid.html#portals-portalidget */ toGetPortal() { return this.to('GetPortal'); } /** * Grants permission to read a Portal Product * * Access Level: Read * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid.html#portalproducts-portalproductidget */ toGetPortalProduct() { return this.to('GetPortalProduct'); } /** * Grants permission to read a Portal Product Sharing Policy * * Access Level: Read * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-sharingpolicy.html#portalproducts-portalproductid-sharingpolicyget */ toGetPortalProductSharingPolicy() { return this.to('GetPortalProductSharingPolicy'); } /** * Grants permission to read a Product Page * * Access Level: Read * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productpages-productpageid.html#portalproducts-portalproductid-productpages-productpageidget */ toGetProductPage() { return this.to('GetProductPage'); } /** * Grants permission to read a Product REST Endpoint Page * * Access Level: Read * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productrestendpointpages-productrestendpointpageid.html#portalproducts-portalproductid-productrestendpointpages-productrestendpointpageidget */ toGetProductRestEndpointPage() { return this.to('GetProductRestEndpointPage'); } /** * Grants permission to read a routing rule * * Access Level: Read * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/domainnames-domainname-routingrules-routingruleid.html#domainnames-domainname-routingrules-routingruleidget */ toGetRoutingRule() { return this.to('GetRoutingRule'); } /** * Grants permission to list Portal Products * * Access Level: List * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts.html#portalproductsget */ toListPortalProducts() { return this.to('ListPortalProducts'); } /** * Grants permission to list Portals * * Access Level: List * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portals.html#portalsget */ toListPortals() { return this.to('ListPortals'); } /** * Grants permission to list Product Pages * * Access Level: List * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productpages.html#portalproducts-portalproductid-productpagesget */ toListProductPages() { return this.to('ListProductPages'); } /** * Grants permission to list Product REST Endpoint Pages * * Access Level: List * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productrestendpointpages.html#portalproducts-portalproductid-productrestendpointpagesget */ toListProductRestEndpointPages() { return this.to('ListProductRestEndpointPages'); } /** * Grants permission to list routing rules under a domain name * * Access Level: List * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/domainnames-domainname-routingrules.html#domainnames-domainname-routingrulesget */ toListRoutingRules() { return this.to('ListRoutingRules'); } /** * Grants permission to update a particular resource * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/api-reference.html */ toPATCH() { return this.to('PATCH'); } /** * Grants permission to create a particular resource * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/api-reference.html */ toPOST() { return this.to('POST'); } /** * Grants permission to update a particular resource * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/api-reference.html */ toPUT() { return this.to('PUT'); } /** * Grants permission to preview a Portal * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portals-portalid-preview.html#portals-portalid-previewpost */ toPreviewPortal() { return this.to('PreviewPortal'); } /** * Grants permission to publish a Portal * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portals-portalid-publish.html#portals-portalid-publishpost */ toPublishPortal() { return this.to('PublishPortal'); } /** * Grants permission to put a Portal Product Sharing Policy * * Access Level: Permissions management, Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-sharingpolicy.html#portalproducts-portalproductid-sharingpolicyput */ toPutPortalProductSharingPolicy() { return this.to('PutPortalProductSharingPolicy'); } /** * Grants permission to update a Portal * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portals-portalid.html#portals-portalidpatch */ toUpdatePortal() { return this.to('UpdatePortal'); } /** * Grants permission to update a Portal Product * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid.html#portalproducts-portalproductidpatch */ toUpdatePortalProduct() { return this.to('UpdatePortalProduct'); } /** * Grants permission to update a Product Page * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productpages-productpageid.html#portalproducts-portalproductid-productpages-productpageidpatch */ toUpdateProductPage() { return this.to('UpdateProductPage'); } /** * Grants permission to update a Product REST Endpoint Page * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/portalproducts-portalproductid-productrestendpointpages-productrestendpointpageid.html#portalproducts-portalproductid-productrestendpointpages-productrestendpointpageidpatch */ toUpdateProductRestEndpointPage() { return this.to('UpdateProductRestEndpointPage'); } /** * Grants permission to update a routing rule using the PutRoutingRule API * * Access Level: Write * * https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/domainnames-domainname-routingrules-routingruleid.html#domainnames-domainname-routingrules-routingruleidput */ toUpdateRoutingRule() { return this.to('UpdateRoutingRule'); } /** * Adds a resource of type AccessLogSettings to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param stageName - Identifier for the stageName. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onAccessLogSettings(apiId, stageName, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/stages/${stageName}/accesslogsettings`); } /** * Adds a resource of type Api to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifRequestApiKeyRequired() * - .ifRequestApiName() * - .ifRequestAuthorizerType() * - .ifRequestAuthorizerUri() * - .ifRequestDisableExecuteApiEndpoint() * - .ifRequestEndpointType() * - .ifRequestRouteAuthorizationType() * - .ifResourceApiKeyRequired() * - .ifResourceApiName() * - .ifResourceAuthorizerType() * - .ifResourceAuthorizerUri() * - .ifResourceDisableExecuteApiEndpoint() * - .ifResourceEndpointType() * - .ifResourceRouteAuthorizationType() * - .ifAwsResourceTag() */ onApi(apiId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}`); } /** * Adds a resource of type ApiMapping to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param domainName - Identifier for the domainName. * @param apiMappingId - Identifier for the apiMappingId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onApiMapping(domainName, apiMappingId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/domainnames/${domainName}/apimappings/${apiMappingId}`); } /** * Adds a resource of type ApiMappings to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param domainName - Identifier for the domainName. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onApiMappings(domainName, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/domainnames/${domainName}/apimappings`); } /** * Adds a resource of type Apis to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifRequestApiKeyRequired() * - .ifRequestApiName() * - .ifRequestAuthorizerType() * - .ifRequestAuthorizerUri() * - .ifRequestDisableExecuteApiEndpoint() * - .ifRequestEndpointType() * - .ifRequestRouteAuthorizationType() * - .ifAwsResourceTag() */ onApis(region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis`); } /** * Adds a resource of type Authorizer to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param authorizerId - Identifier for the authorizerId. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param authorizerId2 - Identifier for the authorizerId2. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifRequestAuthorizerType() * - .ifRequestAuthorizerUri() * - .ifResourceAuthorizerType() * - .ifResourceAuthorizerUri() * - .ifAwsResourceTag() */ onAuthorizer(apiId, authorizerId, partition2, region2, restApiId, authorizerId2, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/authorizers/${authorizerId}, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/authorizers/${authorizerId2}`); } /** * Adds a resource of type Authorizers to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifRequestAuthorizerType() * - .ifRequestAuthorizerUri() * - .ifAwsResourceTag() */ onAuthorizers(apiId, partition2, region2, restApiId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/authorizers, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/authorizers`); } /** * Adds a resource of type AuthorizersCache to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param stageName - Identifier for the stageName. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onAuthorizersCache(apiId, stageName, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/stages/${stageName}/cache/authorizers`); } /** * Adds a resource of type Cors to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onCors(apiId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/cors`); } /** * Adds a resource of type Deployment to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param deploymentId - Identifier for the deploymentId. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param deploymentId2 - Identifier for the deploymentId2. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onDeployment(apiId, deploymentId, partition2, region2, restApiId, deploymentId2, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/deployments/${deploymentId}, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/deployments/${deploymentId2}`); } /** * Adds a resource of type Deployments to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifRequestStageName() * - .ifAwsResourceTag() */ onDeployments(apiId, partition2, region2, restApiId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/deployments, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/deployments`); } /** * Adds a resource of type ExportedAPI to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param specification - Identifier for the specification. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onExportedAPI(apiId, specification, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/exports/${specification}`); } /** * Adds a resource of type Integration to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param integrationId - Identifier for the integrationId. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param resourceId - Identifier for the resourceId. * @param httpMethodType - Identifier for the httpMethodType. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onIntegration(apiId, integrationId, partition2, region2, restApiId, resourceId, httpMethodType, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/integrations/${integrationId}, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/resources/${resourceId}/methods/${httpMethodType}/integration`); } /** * Adds a resource of type IntegrationResponse to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param integrationId - Identifier for the integrationId. * @param integrationResponseId - Identifier for the integrationResponseId. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param resourceId - Identifier for the resourceId. * @param httpMethodType - Identifier for the httpMethodType. * @param statusCode - Identifier for the statusCode. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onIntegrationResponse(apiId, integrationId, integrationResponseId, partition2, region2, restApiId, resourceId, httpMethodType, statusCode, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/integrations/${integrationId}/integrationresponses/${integrationResponseId}, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/resources/${resourceId}/methods/${httpMethodType}/integration/responses/${statusCode}`); } /** * Adds a resource of type IntegrationResponses to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param integrationId - Identifier for the integrationId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onIntegrationResponses(apiId, integrationId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/integrations/${integrationId}/integrationresponses`); } /** * Adds a resource of type Integrations to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onIntegrations(apiId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/integrations`); } /** * Adds a resource of type Model to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param modelId - Identifier for the modelId. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param modelName - Identifier for the modelName. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onModel(apiId, modelId, partition2, region2, restApiId, modelName, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/models/${modelId}, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/models/${modelName}`); } /** * Adds a resource of type ModelTemplate to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param modelId - Identifier for the modelId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onModelTemplate(apiId, modelId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/models/${modelId}/template`); } /** * Adds a resource of type Models to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onModels(apiId, partition2, region2, restApiId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/models, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/models`); } /** * Adds a resource of type Portal to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param portalId - Identifier for the portalId. * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifResourceCognitoUserPoolArn() * - .ifResourcePortalDisplayName() * - .ifResourcePortalDomainName() * - .ifResourcePortalPublishStatus() * - .ifAwsResourceTag() */ onPortal(portalId, account, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}:${account ?? this.defaultAccount}:/portals/${portalId}`); } /** * Adds a resource of type PortalProduct to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param portalProductId - Identifier for the portalProductId. * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifResourcePortalProductDisplayName() * - .ifAwsResourceTag() */ onPortalProduct(portalProductId, account, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}:${account ?? this.defaultAccount}:/portalproducts/${portalProductId}`); } /** * Adds a resource of type ProductPage to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param portalProductId - Identifier for the portalProductId. * @param productPageId - Identifier for the productPageId. * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifResourceProductPageTitle() * - .ifAwsResourceTag() */ onProductPage(portalProductId, productPageId, account, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}:${account ?? this.defaultAccount}:/portalproducts/${portalProductId}/productpages/${productPageId}`); } /** * Adds a resource of type ProductRestEndpointPage to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param portalProductId - Identifier for the portalProductId. * @param productRestEndpointPageId - Identifier for the productRestEndpointPageId. * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifResourceMethod() * - .ifResourceProductRestEndpointPageEndpointPrefix() * - .ifResourceRestApiId() * - .ifResourceStage() * - .ifAwsResourceTag() */ onProductRestEndpointPage(portalProductId, productRestEndpointPageId, account, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}:${account ?? this.defaultAccount}:/portalproducts/${portalProductId}/productrestendpointpages/${productRestEndpointPageId}`); } /** * Adds a resource of type Route to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param routeId - Identifier for the routeId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifRequestApiKeyRequired() * - .ifRequestRouteAuthorizationType() * - .ifResourceApiKeyRequired() * - .ifResourceRouteAuthorizationType() * - .ifAwsResourceTag() */ onRoute(apiId, routeId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/routes/${routeId}`); } /** * Adds a resource of type RouteRequestParameter to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param routeId - Identifier for the routeId. * @param requestParameterKey - Identifier for the requestParameterKey. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onRouteRequestParameter(apiId, routeId, requestParameterKey, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/routes/${routeId}/requestparameters/${requestParameterKey}`); } /** * Adds a resource of type RouteResponse to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param routeId - Identifier for the routeId. * @param routeResponseId - Identifier for the routeResponseId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onRouteResponse(apiId, routeId, routeResponseId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/routes/${routeId}/routeresponses/${routeResponseId}`); } /** * Adds a resource of type RouteResponses to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param routeId - Identifier for the routeId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onRouteResponses(apiId, routeId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/routes/${routeId}/routeresponses`); } /** * Adds a resource of type RouteSettings to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param stageName - Identifier for the stageName. * @param routeKey - Identifier for the routeKey. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onRouteSettings(apiId, stageName, routeKey, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/stages/${stageName}/routesettings/${routeKey}`); } /** * Adds a resource of type Routes to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifRequestApiKeyRequired() * - .ifRequestRouteAuthorizationType() * - .ifAwsResourceTag() */ onRoutes(apiId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/routes`); } /** * Adds a resource of type RoutingRule to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param domainName - Identifier for the domainName. * @param routingRuleId - Identifier for the routingRuleId. * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifResourceConditionBasePaths() * - .ifResourcePriority() * - .ifAwsResourceTag() */ onRoutingRule(domainName, routingRuleId, account, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}:${account ?? this.defaultAccount}:/domainnames/${domainName}/routingrules/${routingRuleId}`); } /** * Adds a resource of type Stage to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param stageName - Identifier for the stageName. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param stageName2 - Identifier for the stageName2. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifRequestAccessLoggingDestination() * - .ifRequestAccessLoggingFormat() * - .ifResourceAccessLoggingDestination() * - .ifResourceAccessLoggingFormat() * - .ifAwsResourceTag() */ onStage(apiId, stageName, partition2, region2, restApiId, stageName2, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/stages/${stageName}, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/stages/${stageName2}`); } /** * Adds a resource of type Stages to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param apiId - Identifier for the apiId. * @param partition2 - Identifier for the partition2. * @param region2 - Identifier for the region2. * @param restApiId - Identifier for the restApiId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifRequestAccessLoggingDestination() * - .ifRequestAccessLoggingFormat() * - .ifAwsResourceTag() */ onStages(apiId, partition2, region2, restApiId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/apis/${apiId}/stages, arn:${partition2}:apigateway:${region2}::/restapis/${restApiId}/stages`); } /** * Adds a resource of type VpcLink to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param vpcLinkId - Identifier for the vpcLinkId. * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onVpcLink(vpcLinkId, region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/vpclinks/${vpcLinkId}`); } /** * Adds a resource of type VpcLinks to the statement * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() */ onVpcLinks(region, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:apigateway:${region ?? this.defaultRegion}::/vpclinks`); } /** * Filters access by access log destination. Available during the CreateStage and UpdateStage operations * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * Applies to actions: * - .toDELETE() * - .toGET() * - .toPATCH() * - .toPOST() * * Applies to resource types: * - Stage * - Stages * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifRequestAccessLoggingDestination(value, operator) { return this.if(`Request/AccessLoggingDestination`, value, operator ?? 'StringLike'); } /** * Filters access by access log format. Available during the CreateStage and UpdateStage operations * * https://docs.aws.amazon.com/apigateway/latest/developerguide/security_iam_service-with-iam.html * * Applies to