github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigateway/restApi.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package apigateway 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Manages an API Gateway REST API. The REST API can be configured via [importing an OpenAPI specification](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html) in the `body` argument (with other arguments serving as overrides) or via other provider resources to manage the resources (`apigateway.Resource` resource), methods (`apigateway.Method` resource), integrations (`apigateway.Integration` resource), etc. of the REST API. Once the REST API is configured, the `apigateway.Deployment` resource can be used along with the `apigateway.Stage` resource to publish the REST API. 15 // 16 // > **Note:** Amazon API Gateway Version 1 resources are used for creating and deploying REST APIs. To create and deploy WebSocket and HTTP APIs, use Amazon API Gateway Version 2 resources. 17 // 18 // !> **WARN:** When importing Open API Specifications with the `body` argument, by default the API Gateway REST API will be replaced with the Open API Specification thus removing any existing methods, resources, integrations, or endpoints. Endpoint mutations are asynchronous operations, and race conditions with DNS are possible. To overcome this limitation, use the `putRestApiMode` attribute and set it to `merge`. 19 // 20 // ## Example Usage 21 // 22 // ## Import 23 // 24 // Using `pulumi import`, import `aws_api_gateway_rest_api` using the REST API ID. For example: 25 // 26 // ```sh 27 // $ pulumi import aws:apigateway/restApi:RestApi example 12345abcde 28 // ``` 29 // ~> __NOTE:__ Resource import does not currently support the `body` attribute. 30 type RestApi struct { 31 pulumi.CustomResourceState 32 33 // Source of the API key for requests. Valid values are `HEADER` (default) and `AUTHORIZER`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-api-key-source` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-api-key-source.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 34 ApiKeySource pulumi.StringOutput `pulumi:"apiKeySource"` 35 // ARN 36 Arn pulumi.StringOutput `pulumi:"arn"` 37 // List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-binary-media-types` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-binary-media-types.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 38 BinaryMediaTypes pulumi.StringArrayOutput `pulumi:"binaryMediaTypes"` 39 // OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any `apigateway.Deployment` creation. More information about REST API OpenAPI support can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 40 Body pulumi.StringPtrOutput `pulumi:"body"` 41 // Creation date of the REST API 42 CreatedDate pulumi.StringOutput `pulumi:"createdDate"` 43 // Description of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.description` field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 44 Description pulumi.StringOutput `pulumi:"description"` 45 // Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to `false`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-endpoint-configuration` extension `disableExecuteApiEndpoint` property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html). If the argument value is `true` and is different than the OpenAPI value, the argument value will override the OpenAPI value. 46 DisableExecuteApiEndpoint pulumi.BoolOutput `pulumi:"disableExecuteApiEndpoint"` 47 // Configuration block defining API endpoint configuration including endpoint type. Defined below. 48 EndpointConfiguration RestApiEndpointConfigurationOutput `pulumi:"endpointConfiguration"` 49 // Execution ARN part to be used in `lambdaPermission`'s `sourceArn` 50 // when allowing API Gateway to invoke a Lambda function, 51 // e.g., `arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j`, which can be concatenated with allowed stage, method and resource path. 52 ExecutionArn pulumi.StringOutput `pulumi:"executionArn"` 53 // Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to `false` 54 FailOnWarnings pulumi.BoolPtrOutput `pulumi:"failOnWarnings"` 55 // Minimum response size to compress for the REST API. String containing an integer value between `-1` and `10485760` (10MB). `-1` will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to `-1`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-minimum-compression-size` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-openapi-minimum-compression-size.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 56 MinimumCompressionSize pulumi.StringOutput `pulumi:"minimumCompressionSize"` 57 // Name of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.title` field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. 58 Name pulumi.StringOutput `pulumi:"name"` 59 // Map of customizations for importing the specification in the `body` argument. For example, to exclude DocumentationParts from an imported API, set `ignore` equal to `documentation`. Additional documentation, including other parameters such as `basepath`, can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 60 Parameters pulumi.StringMapOutput `pulumi:"parameters"` 61 // JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the `apigateway.RestApiPolicy` resource instead. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-policy` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/openapi-extensions-policy.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 62 Policy pulumi.StringOutput `pulumi:"policy"` 63 // Mode of the PutRestApi operation when importing an OpenAPI specification via the `body` argument (create or update operation). Valid values are `merge` and `overwrite`. If unspecificed, defaults to `overwrite` (for backwards compatibility). This corresponds to the [`x-amazon-apigateway-put-integration-method` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-put-integration-method.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 64 PutRestApiMode pulumi.StringPtrOutput `pulumi:"putRestApiMode"` 65 // Resource ID of the REST API's root 66 RootResourceId pulumi.StringOutput `pulumi:"rootResourceId"` 67 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 68 Tags pulumi.StringMapOutput `pulumi:"tags"` 69 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 70 // 71 // Deprecated: Please use `tags` instead. 72 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 73 } 74 75 // NewRestApi registers a new resource with the given unique name, arguments, and options. 76 func NewRestApi(ctx *pulumi.Context, 77 name string, args *RestApiArgs, opts ...pulumi.ResourceOption) (*RestApi, error) { 78 if args == nil { 79 args = &RestApiArgs{} 80 } 81 82 opts = internal.PkgResourceDefaultOpts(opts) 83 var resource RestApi 84 err := ctx.RegisterResource("aws:apigateway/restApi:RestApi", name, args, &resource, opts...) 85 if err != nil { 86 return nil, err 87 } 88 return &resource, nil 89 } 90 91 // GetRestApi gets an existing RestApi resource's state with the given name, ID, and optional 92 // state properties that are used to uniquely qualify the lookup (nil if not required). 93 func GetRestApi(ctx *pulumi.Context, 94 name string, id pulumi.IDInput, state *RestApiState, opts ...pulumi.ResourceOption) (*RestApi, error) { 95 var resource RestApi 96 err := ctx.ReadResource("aws:apigateway/restApi:RestApi", name, id, state, &resource, opts...) 97 if err != nil { 98 return nil, err 99 } 100 return &resource, nil 101 } 102 103 // Input properties used for looking up and filtering RestApi resources. 104 type restApiState struct { 105 // Source of the API key for requests. Valid values are `HEADER` (default) and `AUTHORIZER`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-api-key-source` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-api-key-source.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 106 ApiKeySource *string `pulumi:"apiKeySource"` 107 // ARN 108 Arn *string `pulumi:"arn"` 109 // List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-binary-media-types` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-binary-media-types.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 110 BinaryMediaTypes []string `pulumi:"binaryMediaTypes"` 111 // OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any `apigateway.Deployment` creation. More information about REST API OpenAPI support can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 112 Body *string `pulumi:"body"` 113 // Creation date of the REST API 114 CreatedDate *string `pulumi:"createdDate"` 115 // Description of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.description` field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 116 Description *string `pulumi:"description"` 117 // Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to `false`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-endpoint-configuration` extension `disableExecuteApiEndpoint` property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html). If the argument value is `true` and is different than the OpenAPI value, the argument value will override the OpenAPI value. 118 DisableExecuteApiEndpoint *bool `pulumi:"disableExecuteApiEndpoint"` 119 // Configuration block defining API endpoint configuration including endpoint type. Defined below. 120 EndpointConfiguration *RestApiEndpointConfiguration `pulumi:"endpointConfiguration"` 121 // Execution ARN part to be used in `lambdaPermission`'s `sourceArn` 122 // when allowing API Gateway to invoke a Lambda function, 123 // e.g., `arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j`, which can be concatenated with allowed stage, method and resource path. 124 ExecutionArn *string `pulumi:"executionArn"` 125 // Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to `false` 126 FailOnWarnings *bool `pulumi:"failOnWarnings"` 127 // Minimum response size to compress for the REST API. String containing an integer value between `-1` and `10485760` (10MB). `-1` will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to `-1`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-minimum-compression-size` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-openapi-minimum-compression-size.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 128 MinimumCompressionSize *string `pulumi:"minimumCompressionSize"` 129 // Name of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.title` field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. 130 Name *string `pulumi:"name"` 131 // Map of customizations for importing the specification in the `body` argument. For example, to exclude DocumentationParts from an imported API, set `ignore` equal to `documentation`. Additional documentation, including other parameters such as `basepath`, can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 132 Parameters map[string]string `pulumi:"parameters"` 133 // JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the `apigateway.RestApiPolicy` resource instead. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-policy` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/openapi-extensions-policy.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 134 Policy *string `pulumi:"policy"` 135 // Mode of the PutRestApi operation when importing an OpenAPI specification via the `body` argument (create or update operation). Valid values are `merge` and `overwrite`. If unspecificed, defaults to `overwrite` (for backwards compatibility). This corresponds to the [`x-amazon-apigateway-put-integration-method` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-put-integration-method.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 136 PutRestApiMode *string `pulumi:"putRestApiMode"` 137 // Resource ID of the REST API's root 138 RootResourceId *string `pulumi:"rootResourceId"` 139 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 140 Tags map[string]string `pulumi:"tags"` 141 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 142 // 143 // Deprecated: Please use `tags` instead. 144 TagsAll map[string]string `pulumi:"tagsAll"` 145 } 146 147 type RestApiState struct { 148 // Source of the API key for requests. Valid values are `HEADER` (default) and `AUTHORIZER`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-api-key-source` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-api-key-source.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 149 ApiKeySource pulumi.StringPtrInput 150 // ARN 151 Arn pulumi.StringPtrInput 152 // List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-binary-media-types` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-binary-media-types.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 153 BinaryMediaTypes pulumi.StringArrayInput 154 // OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any `apigateway.Deployment` creation. More information about REST API OpenAPI support can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 155 Body pulumi.StringPtrInput 156 // Creation date of the REST API 157 CreatedDate pulumi.StringPtrInput 158 // Description of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.description` field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 159 Description pulumi.StringPtrInput 160 // Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to `false`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-endpoint-configuration` extension `disableExecuteApiEndpoint` property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html). If the argument value is `true` and is different than the OpenAPI value, the argument value will override the OpenAPI value. 161 DisableExecuteApiEndpoint pulumi.BoolPtrInput 162 // Configuration block defining API endpoint configuration including endpoint type. Defined below. 163 EndpointConfiguration RestApiEndpointConfigurationPtrInput 164 // Execution ARN part to be used in `lambdaPermission`'s `sourceArn` 165 // when allowing API Gateway to invoke a Lambda function, 166 // e.g., `arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j`, which can be concatenated with allowed stage, method and resource path. 167 ExecutionArn pulumi.StringPtrInput 168 // Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to `false` 169 FailOnWarnings pulumi.BoolPtrInput 170 // Minimum response size to compress for the REST API. String containing an integer value between `-1` and `10485760` (10MB). `-1` will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to `-1`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-minimum-compression-size` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-openapi-minimum-compression-size.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 171 MinimumCompressionSize pulumi.StringPtrInput 172 // Name of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.title` field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. 173 Name pulumi.StringPtrInput 174 // Map of customizations for importing the specification in the `body` argument. For example, to exclude DocumentationParts from an imported API, set `ignore` equal to `documentation`. Additional documentation, including other parameters such as `basepath`, can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 175 Parameters pulumi.StringMapInput 176 // JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the `apigateway.RestApiPolicy` resource instead. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-policy` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/openapi-extensions-policy.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 177 Policy pulumi.StringPtrInput 178 // Mode of the PutRestApi operation when importing an OpenAPI specification via the `body` argument (create or update operation). Valid values are `merge` and `overwrite`. If unspecificed, defaults to `overwrite` (for backwards compatibility). This corresponds to the [`x-amazon-apigateway-put-integration-method` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-put-integration-method.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 179 PutRestApiMode pulumi.StringPtrInput 180 // Resource ID of the REST API's root 181 RootResourceId pulumi.StringPtrInput 182 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 183 Tags pulumi.StringMapInput 184 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 185 // 186 // Deprecated: Please use `tags` instead. 187 TagsAll pulumi.StringMapInput 188 } 189 190 func (RestApiState) ElementType() reflect.Type { 191 return reflect.TypeOf((*restApiState)(nil)).Elem() 192 } 193 194 type restApiArgs struct { 195 // Source of the API key for requests. Valid values are `HEADER` (default) and `AUTHORIZER`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-api-key-source` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-api-key-source.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 196 ApiKeySource *string `pulumi:"apiKeySource"` 197 // List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-binary-media-types` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-binary-media-types.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 198 BinaryMediaTypes []string `pulumi:"binaryMediaTypes"` 199 // OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any `apigateway.Deployment` creation. More information about REST API OpenAPI support can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 200 Body *string `pulumi:"body"` 201 // Description of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.description` field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 202 Description *string `pulumi:"description"` 203 // Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to `false`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-endpoint-configuration` extension `disableExecuteApiEndpoint` property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html). If the argument value is `true` and is different than the OpenAPI value, the argument value will override the OpenAPI value. 204 DisableExecuteApiEndpoint *bool `pulumi:"disableExecuteApiEndpoint"` 205 // Configuration block defining API endpoint configuration including endpoint type. Defined below. 206 EndpointConfiguration *RestApiEndpointConfiguration `pulumi:"endpointConfiguration"` 207 // Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to `false` 208 FailOnWarnings *bool `pulumi:"failOnWarnings"` 209 // Minimum response size to compress for the REST API. String containing an integer value between `-1` and `10485760` (10MB). `-1` will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to `-1`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-minimum-compression-size` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-openapi-minimum-compression-size.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 210 MinimumCompressionSize *string `pulumi:"minimumCompressionSize"` 211 // Name of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.title` field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. 212 Name *string `pulumi:"name"` 213 // Map of customizations for importing the specification in the `body` argument. For example, to exclude DocumentationParts from an imported API, set `ignore` equal to `documentation`. Additional documentation, including other parameters such as `basepath`, can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 214 Parameters map[string]string `pulumi:"parameters"` 215 // JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the `apigateway.RestApiPolicy` resource instead. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-policy` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/openapi-extensions-policy.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 216 Policy *string `pulumi:"policy"` 217 // Mode of the PutRestApi operation when importing an OpenAPI specification via the `body` argument (create or update operation). Valid values are `merge` and `overwrite`. If unspecificed, defaults to `overwrite` (for backwards compatibility). This corresponds to the [`x-amazon-apigateway-put-integration-method` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-put-integration-method.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 218 PutRestApiMode *string `pulumi:"putRestApiMode"` 219 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 220 Tags map[string]string `pulumi:"tags"` 221 } 222 223 // The set of arguments for constructing a RestApi resource. 224 type RestApiArgs struct { 225 // Source of the API key for requests. Valid values are `HEADER` (default) and `AUTHORIZER`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-api-key-source` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-api-key-source.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 226 ApiKeySource pulumi.StringPtrInput 227 // List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-binary-media-types` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-binary-media-types.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 228 BinaryMediaTypes pulumi.StringArrayInput 229 // OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any `apigateway.Deployment` creation. More information about REST API OpenAPI support can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 230 Body pulumi.StringPtrInput 231 // Description of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.description` field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 232 Description pulumi.StringPtrInput 233 // Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to `false`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-endpoint-configuration` extension `disableExecuteApiEndpoint` property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html). If the argument value is `true` and is different than the OpenAPI value, the argument value will override the OpenAPI value. 234 DisableExecuteApiEndpoint pulumi.BoolPtrInput 235 // Configuration block defining API endpoint configuration including endpoint type. Defined below. 236 EndpointConfiguration RestApiEndpointConfigurationPtrInput 237 // Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to `false` 238 FailOnWarnings pulumi.BoolPtrInput 239 // Minimum response size to compress for the REST API. String containing an integer value between `-1` and `10485760` (10MB). `-1` will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to `-1`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-minimum-compression-size` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-openapi-minimum-compression-size.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 240 MinimumCompressionSize pulumi.StringPtrInput 241 // Name of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.title` field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. 242 Name pulumi.StringPtrInput 243 // Map of customizations for importing the specification in the `body` argument. For example, to exclude DocumentationParts from an imported API, set `ignore` equal to `documentation`. Additional documentation, including other parameters such as `basepath`, can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 244 Parameters pulumi.StringMapInput 245 // JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the `apigateway.RestApiPolicy` resource instead. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-policy` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/openapi-extensions-policy.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 246 Policy pulumi.StringPtrInput 247 // Mode of the PutRestApi operation when importing an OpenAPI specification via the `body` argument (create or update operation). Valid values are `merge` and `overwrite`. If unspecificed, defaults to `overwrite` (for backwards compatibility). This corresponds to the [`x-amazon-apigateway-put-integration-method` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-put-integration-method.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 248 PutRestApiMode pulumi.StringPtrInput 249 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 250 Tags pulumi.StringMapInput 251 } 252 253 func (RestApiArgs) ElementType() reflect.Type { 254 return reflect.TypeOf((*restApiArgs)(nil)).Elem() 255 } 256 257 type RestApiInput interface { 258 pulumi.Input 259 260 ToRestApiOutput() RestApiOutput 261 ToRestApiOutputWithContext(ctx context.Context) RestApiOutput 262 } 263 264 func (*RestApi) ElementType() reflect.Type { 265 return reflect.TypeOf((**RestApi)(nil)).Elem() 266 } 267 268 func (i *RestApi) ToRestApiOutput() RestApiOutput { 269 return i.ToRestApiOutputWithContext(context.Background()) 270 } 271 272 func (i *RestApi) ToRestApiOutputWithContext(ctx context.Context) RestApiOutput { 273 return pulumi.ToOutputWithContext(ctx, i).(RestApiOutput) 274 } 275 276 // RestApiArrayInput is an input type that accepts RestApiArray and RestApiArrayOutput values. 277 // You can construct a concrete instance of `RestApiArrayInput` via: 278 // 279 // RestApiArray{ RestApiArgs{...} } 280 type RestApiArrayInput interface { 281 pulumi.Input 282 283 ToRestApiArrayOutput() RestApiArrayOutput 284 ToRestApiArrayOutputWithContext(context.Context) RestApiArrayOutput 285 } 286 287 type RestApiArray []RestApiInput 288 289 func (RestApiArray) ElementType() reflect.Type { 290 return reflect.TypeOf((*[]*RestApi)(nil)).Elem() 291 } 292 293 func (i RestApiArray) ToRestApiArrayOutput() RestApiArrayOutput { 294 return i.ToRestApiArrayOutputWithContext(context.Background()) 295 } 296 297 func (i RestApiArray) ToRestApiArrayOutputWithContext(ctx context.Context) RestApiArrayOutput { 298 return pulumi.ToOutputWithContext(ctx, i).(RestApiArrayOutput) 299 } 300 301 // RestApiMapInput is an input type that accepts RestApiMap and RestApiMapOutput values. 302 // You can construct a concrete instance of `RestApiMapInput` via: 303 // 304 // RestApiMap{ "key": RestApiArgs{...} } 305 type RestApiMapInput interface { 306 pulumi.Input 307 308 ToRestApiMapOutput() RestApiMapOutput 309 ToRestApiMapOutputWithContext(context.Context) RestApiMapOutput 310 } 311 312 type RestApiMap map[string]RestApiInput 313 314 func (RestApiMap) ElementType() reflect.Type { 315 return reflect.TypeOf((*map[string]*RestApi)(nil)).Elem() 316 } 317 318 func (i RestApiMap) ToRestApiMapOutput() RestApiMapOutput { 319 return i.ToRestApiMapOutputWithContext(context.Background()) 320 } 321 322 func (i RestApiMap) ToRestApiMapOutputWithContext(ctx context.Context) RestApiMapOutput { 323 return pulumi.ToOutputWithContext(ctx, i).(RestApiMapOutput) 324 } 325 326 type RestApiOutput struct{ *pulumi.OutputState } 327 328 func (RestApiOutput) ElementType() reflect.Type { 329 return reflect.TypeOf((**RestApi)(nil)).Elem() 330 } 331 332 func (o RestApiOutput) ToRestApiOutput() RestApiOutput { 333 return o 334 } 335 336 func (o RestApiOutput) ToRestApiOutputWithContext(ctx context.Context) RestApiOutput { 337 return o 338 } 339 340 // Source of the API key for requests. Valid values are `HEADER` (default) and `AUTHORIZER`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-api-key-source` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-api-key-source.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 341 func (o RestApiOutput) ApiKeySource() pulumi.StringOutput { 342 return o.ApplyT(func(v *RestApi) pulumi.StringOutput { return v.ApiKeySource }).(pulumi.StringOutput) 343 } 344 345 // ARN 346 func (o RestApiOutput) Arn() pulumi.StringOutput { 347 return o.ApplyT(func(v *RestApi) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 348 } 349 350 // List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-binary-media-types` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-binary-media-types.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 351 func (o RestApiOutput) BinaryMediaTypes() pulumi.StringArrayOutput { 352 return o.ApplyT(func(v *RestApi) pulumi.StringArrayOutput { return v.BinaryMediaTypes }).(pulumi.StringArrayOutput) 353 } 354 355 // OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any `apigateway.Deployment` creation. More information about REST API OpenAPI support can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 356 func (o RestApiOutput) Body() pulumi.StringPtrOutput { 357 return o.ApplyT(func(v *RestApi) pulumi.StringPtrOutput { return v.Body }).(pulumi.StringPtrOutput) 358 } 359 360 // Creation date of the REST API 361 func (o RestApiOutput) CreatedDate() pulumi.StringOutput { 362 return o.ApplyT(func(v *RestApi) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput) 363 } 364 365 // Description of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.description` field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 366 func (o RestApiOutput) Description() pulumi.StringOutput { 367 return o.ApplyT(func(v *RestApi) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput) 368 } 369 370 // Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to `false`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-endpoint-configuration` extension `disableExecuteApiEndpoint` property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html). If the argument value is `true` and is different than the OpenAPI value, the argument value will override the OpenAPI value. 371 func (o RestApiOutput) DisableExecuteApiEndpoint() pulumi.BoolOutput { 372 return o.ApplyT(func(v *RestApi) pulumi.BoolOutput { return v.DisableExecuteApiEndpoint }).(pulumi.BoolOutput) 373 } 374 375 // Configuration block defining API endpoint configuration including endpoint type. Defined below. 376 func (o RestApiOutput) EndpointConfiguration() RestApiEndpointConfigurationOutput { 377 return o.ApplyT(func(v *RestApi) RestApiEndpointConfigurationOutput { return v.EndpointConfiguration }).(RestApiEndpointConfigurationOutput) 378 } 379 380 // Execution ARN part to be used in `lambdaPermission`'s `sourceArn` 381 // when allowing API Gateway to invoke a Lambda function, 382 // e.g., `arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j`, which can be concatenated with allowed stage, method and resource path. 383 func (o RestApiOutput) ExecutionArn() pulumi.StringOutput { 384 return o.ApplyT(func(v *RestApi) pulumi.StringOutput { return v.ExecutionArn }).(pulumi.StringOutput) 385 } 386 387 // Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to `false` 388 func (o RestApiOutput) FailOnWarnings() pulumi.BoolPtrOutput { 389 return o.ApplyT(func(v *RestApi) pulumi.BoolPtrOutput { return v.FailOnWarnings }).(pulumi.BoolPtrOutput) 390 } 391 392 // Minimum response size to compress for the REST API. String containing an integer value between `-1` and `10485760` (10MB). `-1` will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to `-1`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-minimum-compression-size` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-openapi-minimum-compression-size.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 393 func (o RestApiOutput) MinimumCompressionSize() pulumi.StringOutput { 394 return o.ApplyT(func(v *RestApi) pulumi.StringOutput { return v.MinimumCompressionSize }).(pulumi.StringOutput) 395 } 396 397 // Name of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.title` field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. 398 func (o RestApiOutput) Name() pulumi.StringOutput { 399 return o.ApplyT(func(v *RestApi) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 400 } 401 402 // Map of customizations for importing the specification in the `body` argument. For example, to exclude DocumentationParts from an imported API, set `ignore` equal to `documentation`. Additional documentation, including other parameters such as `basepath`, can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). 403 func (o RestApiOutput) Parameters() pulumi.StringMapOutput { 404 return o.ApplyT(func(v *RestApi) pulumi.StringMapOutput { return v.Parameters }).(pulumi.StringMapOutput) 405 } 406 407 // JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the `apigateway.RestApiPolicy` resource instead. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-policy` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/openapi-extensions-policy.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 408 func (o RestApiOutput) Policy() pulumi.StringOutput { 409 return o.ApplyT(func(v *RestApi) pulumi.StringOutput { return v.Policy }).(pulumi.StringOutput) 410 } 411 412 // Mode of the PutRestApi operation when importing an OpenAPI specification via the `body` argument (create or update operation). Valid values are `merge` and `overwrite`. If unspecificed, defaults to `overwrite` (for backwards compatibility). This corresponds to the [`x-amazon-apigateway-put-integration-method` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-put-integration-method.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. 413 func (o RestApiOutput) PutRestApiMode() pulumi.StringPtrOutput { 414 return o.ApplyT(func(v *RestApi) pulumi.StringPtrOutput { return v.PutRestApiMode }).(pulumi.StringPtrOutput) 415 } 416 417 // Resource ID of the REST API's root 418 func (o RestApiOutput) RootResourceId() pulumi.StringOutput { 419 return o.ApplyT(func(v *RestApi) pulumi.StringOutput { return v.RootResourceId }).(pulumi.StringOutput) 420 } 421 422 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 423 func (o RestApiOutput) Tags() pulumi.StringMapOutput { 424 return o.ApplyT(func(v *RestApi) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 425 } 426 427 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 428 // 429 // Deprecated: Please use `tags` instead. 430 func (o RestApiOutput) TagsAll() pulumi.StringMapOutput { 431 return o.ApplyT(func(v *RestApi) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 432 } 433 434 type RestApiArrayOutput struct{ *pulumi.OutputState } 435 436 func (RestApiArrayOutput) ElementType() reflect.Type { 437 return reflect.TypeOf((*[]*RestApi)(nil)).Elem() 438 } 439 440 func (o RestApiArrayOutput) ToRestApiArrayOutput() RestApiArrayOutput { 441 return o 442 } 443 444 func (o RestApiArrayOutput) ToRestApiArrayOutputWithContext(ctx context.Context) RestApiArrayOutput { 445 return o 446 } 447 448 func (o RestApiArrayOutput) Index(i pulumi.IntInput) RestApiOutput { 449 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RestApi { 450 return vs[0].([]*RestApi)[vs[1].(int)] 451 }).(RestApiOutput) 452 } 453 454 type RestApiMapOutput struct{ *pulumi.OutputState } 455 456 func (RestApiMapOutput) ElementType() reflect.Type { 457 return reflect.TypeOf((*map[string]*RestApi)(nil)).Elem() 458 } 459 460 func (o RestApiMapOutput) ToRestApiMapOutput() RestApiMapOutput { 461 return o 462 } 463 464 func (o RestApiMapOutput) ToRestApiMapOutputWithContext(ctx context.Context) RestApiMapOutput { 465 return o 466 } 467 468 func (o RestApiMapOutput) MapIndex(k pulumi.StringInput) RestApiOutput { 469 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RestApi { 470 return vs[0].(map[string]*RestApi)[vs[1].(string)] 471 }).(RestApiOutput) 472 } 473 474 func init() { 475 pulumi.RegisterInputType(reflect.TypeOf((*RestApiInput)(nil)).Elem(), &RestApi{}) 476 pulumi.RegisterInputType(reflect.TypeOf((*RestApiArrayInput)(nil)).Elem(), RestApiArray{}) 477 pulumi.RegisterInputType(reflect.TypeOf((*RestApiMapInput)(nil)).Elem(), RestApiMap{}) 478 pulumi.RegisterOutputType(RestApiOutput{}) 479 pulumi.RegisterOutputType(RestApiArrayOutput{}) 480 pulumi.RegisterOutputType(RestApiMapOutput{}) 481 }