From 3d7688f96dcfef910a1ee83739fac57fd5355f83 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Mon, 27 Nov 2023 15:49:44 +0000 Subject: [PATCH] Rename domain properties - Rename DomainConfiguration type and property to DomainName to match original resource name. --- awsx/apigatewayv2/httpApi.ts | 18 +- awsx/schema-types.ts | 24 +- schema.json | 54 +- schemagen/pkg/gen/apigatewayv2.go | 22 +- .../Apigatewayv2/Inputs/DomainMappingArgs.cs | 12 +- ...ConfigurationArgs.cs => DomainNameArgs.cs} | 6 +- sdk/go/awsx/apigatewayv2/pulumiTypes.go | 582 +++++++++--------- .../inputs/DomainMappingArgs.java | 48 +- ...igurationArgs.java => DomainNameArgs.java} | 20 +- sdk/nodejs/types/input.ts | 276 ++++----- .../pulumi_awsx/apigatewayv2/_inputs.py | 376 +++++------ 11 files changed, 717 insertions(+), 721 deletions(-) rename sdk/dotnet/Apigatewayv2/Inputs/{DomainConfigurationArgs.cs => DomainNameArgs.cs} (98%) rename sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/{DomainConfigurationArgs.java => DomainNameArgs.java} (93%) diff --git a/awsx/apigatewayv2/httpApi.ts b/awsx/apigatewayv2/httpApi.ts index 3d2b537e6..3c00bf52a 100644 --- a/awsx/apigatewayv2/httpApi.ts +++ b/awsx/apigatewayv2/httpApi.ts @@ -243,25 +243,25 @@ export function buildHttpApi(parent: pulumi.Resource, name: string, args: schema { parent, dependsOn: [...routeResources, ...stageResources] }, ); - function makeDomainMapping(domainName: string, domainMappingInput: schema.DomainMappingInputs) { - const { domainConfiguration, domainId, ...apiMappingArgs } = domainMappingInput; + function makeDomainMapping(domainKey: string, domainMappingInput: schema.DomainMappingInputs) { + const { domainName, domainId, ...apiMappingArgs } = domainMappingInput; if ( - (domainId === undefined && domainConfiguration === undefined) || - (domainId !== undefined && domainConfiguration !== undefined) + (domainId === undefined && domainName === undefined) || + (domainId !== undefined && domainName !== undefined) ) { throw new Error( - `Exactly one of domainId or domainConfiguration must be specified for domain ${domainName}`, + `Exactly one of domainId or domainConfiguration must be specified for domain ${domainKey}`, ); } let resolvedDomainId = domainId; - const domainResourceName = domainName.replace(/\W+/g, "-"); + const domainResourceName = domainKey.replace(/\W+/g, "-"); let domainResource: aws.apigatewayv2.DomainName | undefined; - if (domainConfiguration !== undefined) { + if (domainName !== undefined) { domainResource = new aws.apigatewayv2.DomainName( `${name}-${domainResourceName}`, { - domainName: domainName, - ...domainConfiguration, + domainName: domainKey, + ...domainName, }, { parent }, ); diff --git a/awsx/schema-types.ts b/awsx/schema-types.ts index 9a5819340..e593f2a76 100644 --- a/awsx/schema-types.ts +++ b/awsx/schema-types.ts @@ -388,28 +388,28 @@ export interface TargetGroupAttachmentArgs { readonly targetGroup?: pulumi.Input; readonly targetGroupArn?: pulumi.Input; } -export interface DomainConfigurationInputs { - readonly domainNameConfiguration: pulumi.Input; - readonly mutualTlsAuthentication?: pulumi.Input; - readonly tags?: pulumi.Input>>; -} -export interface DomainConfigurationOutputs { - readonly domainNameConfiguration: pulumi.Output; - readonly mutualTlsAuthentication?: pulumi.Output; - readonly tags?: pulumi.Output>; -} export interface DomainMappingInputs { readonly apiMappingKey?: pulumi.Input; - readonly domainConfiguration?: DomainConfigurationInputs; readonly domainId?: pulumi.Input; + readonly domainName?: DomainNameInputs; readonly stage: pulumi.Input; } export interface DomainMappingOutputs { readonly apiMappingKey?: pulumi.Output; - readonly domainConfiguration?: DomainConfigurationOutputs; readonly domainId?: pulumi.Output; + readonly domainName?: DomainNameOutputs; readonly stage: pulumi.Output; } +export interface DomainNameInputs { + readonly domainNameConfiguration: pulumi.Input; + readonly mutualTlsAuthentication?: pulumi.Input; + readonly tags?: pulumi.Input>>; +} +export interface DomainNameOutputs { + readonly domainNameConfiguration: pulumi.Output; + readonly mutualTlsAuthentication?: pulumi.Output; + readonly tags?: pulumi.Output>; +} export interface HttpAuthorizerInputs { readonly authorizerCredentialsArn?: pulumi.Input; readonly authorizerPayloadFormatVersion?: pulumi.Input; diff --git a/schema.json b/schema.json index a763b42e6..60ccab4b3 100644 --- a/schema.json +++ b/schema.json @@ -66,7 +66,33 @@ }, "config": {}, "types": { - "awsx:apigatewayv2:DomainConfiguration": { + "awsx:apigatewayv2:DomainMapping": { + "description": "Manages an Amazon API Gateway Version 2 API mapping.\nMore information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html).\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n### Basic\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst example = new aws.apigatewayv2.ApiMapping(\"example\", {\n apiId: aws_apigatewayv2_api.example.id,\n domainName: aws_apigatewayv2_domain_name.example.id,\n stage: aws_apigatewayv2_stage.example.id,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nexample = aws.apigatewayv2.ApiMapping(\"example\",\n api_id=aws_apigatewayv2_api[\"example\"][\"id\"],\n domain_name=aws_apigatewayv2_domain_name[\"example\"][\"id\"],\n stage=aws_apigatewayv2_stage[\"example\"][\"id\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Aws.ApiGatewayV2.ApiMapping(\"example\", new()\n {\n ApiId = aws_apigatewayv2_api.Example.Id,\n DomainName = aws_apigatewayv2_domain_name.Example.Id,\n Stage = aws_apigatewayv2_stage.Example.Id,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := apigatewayv2.NewApiMapping(ctx, \"example\", \u0026apigatewayv2.ApiMappingArgs{\n\t\t\tApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id),\n\t\t\tDomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id),\n\t\t\tStage: pulumi.Any(aws_apigatewayv2_stage.Example.Id),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.apigatewayv2.ApiMapping;\nimport com.pulumi.aws.apigatewayv2.ApiMappingArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new ApiMapping(\"example\", ApiMappingArgs.builder() \n .apiId(aws_apigatewayv2_api.example().id())\n .domainName(aws_apigatewayv2_domain_name.example().id())\n .stage(aws_apigatewayv2_stage.example().id())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: aws:apigatewayv2:ApiMapping\n properties:\n apiId: ${aws_apigatewayv2_api.example.id}\n domainName: ${aws_apigatewayv2_domain_name.example.id}\n stage: ${aws_apigatewayv2_stage.example.id}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nUsing `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example:\n\n```sh\n $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com\n```\n ", + "properties": { + "apiMappingKey": { + "type": "string", + "description": "The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html).\n" + }, + "domainId": { + "type": "string", + "description": "Identifier of an existing domain. Cannot be specified together with `DomainName`." + }, + "domainName": { + "$ref": "#/types/awsx:apigatewayv2:DomainName", + "plain": true, + "description": "Configuration of the domain name to create. Cannot be specified together with `domainId`." + }, + "stage": { + "type": "string", + "description": "API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage.\n" + } + }, + "type": "object", + "required": [ + "stage" + ] + }, + "awsx:apigatewayv2:DomainName": { "description": "Manages an Amazon API Gateway Version 2 domain name.\nMore information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html).\n\n\u003e **Note:** This resource establishes ownership of and the TLS settings for\na particular domain name. An API stage can be associated with the domain name using the `aws.apigatewayv2.ApiMapping` resource.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n### Basic\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst example = new aws.apigatewayv2.DomainName(\"example\", {\n domainName: \"ws-api.example.com\",\n domainNameConfiguration: {\n certificateArn: aws_acm_certificate.example.arn,\n endpointType: \"REGIONAL\",\n securityPolicy: \"TLS_1_2\",\n },\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nexample = aws.apigatewayv2.DomainName(\"example\",\n domain_name=\"ws-api.example.com\",\n domain_name_configuration=aws.apigatewayv2.DomainNameDomainNameConfigurationArgs(\n certificate_arn=aws_acm_certificate[\"example\"][\"arn\"],\n endpoint_type=\"REGIONAL\",\n security_policy=\"TLS_1_2\",\n ))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Aws.ApiGatewayV2.DomainName(\"example\", new()\n {\n Domain = \"ws-api.example.com\",\n DomainNameConfiguration = new Aws.ApiGatewayV2.Inputs.DomainNameDomainNameConfigurationArgs\n {\n CertificateArn = aws_acm_certificate.Example.Arn,\n EndpointType = \"REGIONAL\",\n SecurityPolicy = \"TLS_1_2\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := apigatewayv2.NewDomainName(ctx, \"example\", \u0026apigatewayv2.DomainNameArgs{\n\t\t\tDomainName: pulumi.String(\"ws-api.example.com\"),\n\t\t\tDomainNameConfiguration: \u0026apigatewayv2.DomainNameDomainNameConfigurationArgs{\n\t\t\t\tCertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn),\n\t\t\t\tEndpointType: pulumi.String(\"REGIONAL\"),\n\t\t\t\tSecurityPolicy: pulumi.String(\"TLS_1_2\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.apigatewayv2.DomainName;\nimport com.pulumi.aws.apigatewayv2.DomainNameArgs;\nimport com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new DomainName(\"example\", DomainNameArgs.builder() \n .domainName(\"ws-api.example.com\")\n .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder()\n .certificateArn(aws_acm_certificate.example().arn())\n .endpointType(\"REGIONAL\")\n .securityPolicy(\"TLS_1_2\")\n .build())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: aws:apigatewayv2:DomainName\n properties:\n domainName: ws-api.example.com\n domainNameConfiguration:\n certificateArn: ${aws_acm_certificate.example.arn}\n endpointType: REGIONAL\n securityPolicy: TLS_1_2\n```\n{{% /example %}}\n{{% example %}}\n### Associated Route 53 Resource Record\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst exampleDomainName = new aws.apigatewayv2.DomainName(\"exampleDomainName\", {\n domainName: \"http-api.example.com\",\n domainNameConfiguration: {\n certificateArn: aws_acm_certificate.example.arn,\n endpointType: \"REGIONAL\",\n securityPolicy: \"TLS_1_2\",\n },\n});\nconst exampleRecord = new aws.route53.Record(\"exampleRecord\", {\n name: exampleDomainName.domainName,\n type: \"A\",\n zoneId: aws_route53_zone.example.zone_id,\n aliases: [{\n name: exampleDomainName.domainNameConfiguration.apply(domainNameConfiguration =\u003e domainNameConfiguration.targetDomainName),\n zoneId: exampleDomainName.domainNameConfiguration.apply(domainNameConfiguration =\u003e domainNameConfiguration.hostedZoneId),\n evaluateTargetHealth: false,\n }],\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nexample_domain_name = aws.apigatewayv2.DomainName(\"exampleDomainName\",\n domain_name=\"http-api.example.com\",\n domain_name_configuration=aws.apigatewayv2.DomainNameDomainNameConfigurationArgs(\n certificate_arn=aws_acm_certificate[\"example\"][\"arn\"],\n endpoint_type=\"REGIONAL\",\n security_policy=\"TLS_1_2\",\n ))\nexample_record = aws.route53.Record(\"exampleRecord\",\n name=example_domain_name.domain_name,\n type=\"A\",\n zone_id=aws_route53_zone[\"example\"][\"zone_id\"],\n aliases=[aws.route53.RecordAliasArgs(\n name=example_domain_name.domain_name_configuration.target_domain_name,\n zone_id=example_domain_name.domain_name_configuration.hosted_zone_id,\n evaluate_target_health=False,\n )])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var exampleDomainName = new Aws.ApiGatewayV2.DomainName(\"exampleDomainName\", new()\n {\n Domain = \"http-api.example.com\",\n DomainNameConfiguration = new Aws.ApiGatewayV2.Inputs.DomainNameDomainNameConfigurationArgs\n {\n CertificateArn = aws_acm_certificate.Example.Arn,\n EndpointType = \"REGIONAL\",\n SecurityPolicy = \"TLS_1_2\",\n },\n });\n\n var exampleRecord = new Aws.Route53.Record(\"exampleRecord\", new()\n {\n Name = exampleDomainName.Domain,\n Type = \"A\",\n ZoneId = aws_route53_zone.Example.Zone_id,\n Aliases = new[]\n {\n new Aws.Route53.Inputs.RecordAliasArgs\n {\n Name = exampleDomainName.DomainNameConfiguration.Apply(domainNameConfiguration =\u003e domainNameConfiguration.TargetDomainName),\n ZoneId = exampleDomainName.DomainNameConfiguration.Apply(domainNameConfiguration =\u003e domainNameConfiguration.HostedZoneId),\n EvaluateTargetHealth = false,\n },\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2\"\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\texampleDomainName, err := apigatewayv2.NewDomainName(ctx, \"exampleDomainName\", \u0026apigatewayv2.DomainNameArgs{\n\t\t\tDomainName: pulumi.String(\"http-api.example.com\"),\n\t\t\tDomainNameConfiguration: \u0026apigatewayv2.DomainNameDomainNameConfigurationArgs{\n\t\t\t\tCertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn),\n\t\t\t\tEndpointType: pulumi.String(\"REGIONAL\"),\n\t\t\t\tSecurityPolicy: pulumi.String(\"TLS_1_2\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = route53.NewRecord(ctx, \"exampleRecord\", \u0026route53.RecordArgs{\n\t\t\tName: exampleDomainName.DomainName,\n\t\t\tType: pulumi.String(\"A\"),\n\t\t\tZoneId: pulumi.Any(aws_route53_zone.Example.Zone_id),\n\t\t\tAliases: route53.RecordAliasArray{\n\t\t\t\t\u0026route53.RecordAliasArgs{\n\t\t\t\t\tName: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) {\n\t\t\t\t\t\treturn \u0026domainNameConfiguration.TargetDomainName, nil\n\t\t\t\t\t}).(pulumi.StringPtrOutput),\n\t\t\t\t\tZoneId: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) {\n\t\t\t\t\t\treturn \u0026domainNameConfiguration.HostedZoneId, nil\n\t\t\t\t\t}).(pulumi.StringPtrOutput),\n\t\t\t\t\tEvaluateTargetHealth: pulumi.Bool(false),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.apigatewayv2.DomainName;\nimport com.pulumi.aws.apigatewayv2.DomainNameArgs;\nimport com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs;\nimport com.pulumi.aws.route53.Record;\nimport com.pulumi.aws.route53.RecordArgs;\nimport com.pulumi.aws.route53.inputs.RecordAliasArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var exampleDomainName = new DomainName(\"exampleDomainName\", DomainNameArgs.builder() \n .domainName(\"http-api.example.com\")\n .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder()\n .certificateArn(aws_acm_certificate.example().arn())\n .endpointType(\"REGIONAL\")\n .securityPolicy(\"TLS_1_2\")\n .build())\n .build());\n\n var exampleRecord = new Record(\"exampleRecord\", RecordArgs.builder() \n .name(exampleDomainName.domainName())\n .type(\"A\")\n .zoneId(aws_route53_zone.example().zone_id())\n .aliases(RecordAliasArgs.builder()\n .name(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -\u003e domainNameConfiguration.targetDomainName()))\n .zoneId(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -\u003e domainNameConfiguration.hostedZoneId()))\n .evaluateTargetHealth(false)\n .build())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n exampleDomainName:\n type: aws:apigatewayv2:DomainName\n properties:\n domainName: http-api.example.com\n domainNameConfiguration:\n certificateArn: ${aws_acm_certificate.example.arn}\n endpointType: REGIONAL\n securityPolicy: TLS_1_2\n exampleRecord:\n type: aws:route53:Record\n properties:\n name: ${exampleDomainName.domainName}\n type: A\n zoneId: ${aws_route53_zone.example.zone_id}\n aliases:\n - name: ${exampleDomainName.domainNameConfiguration.targetDomainName}\n zoneId: ${exampleDomainName.domainNameConfiguration.hostedZoneId}\n evaluateTargetHealth: false\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nUsing `pulumi import`, import `aws_apigatewayv2_domain_name` using the domain name. For example:\n\n```sh\n $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com\n```\n ", "properties": { "domainNameConfiguration": { @@ -90,32 +116,6 @@ "domainNameConfiguration" ] }, - "awsx:apigatewayv2:DomainMapping": { - "description": "Manages an Amazon API Gateway Version 2 API mapping.\nMore information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html).\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n### Basic\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst example = new aws.apigatewayv2.ApiMapping(\"example\", {\n apiId: aws_apigatewayv2_api.example.id,\n domainName: aws_apigatewayv2_domain_name.example.id,\n stage: aws_apigatewayv2_stage.example.id,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nexample = aws.apigatewayv2.ApiMapping(\"example\",\n api_id=aws_apigatewayv2_api[\"example\"][\"id\"],\n domain_name=aws_apigatewayv2_domain_name[\"example\"][\"id\"],\n stage=aws_apigatewayv2_stage[\"example\"][\"id\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Aws.ApiGatewayV2.ApiMapping(\"example\", new()\n {\n ApiId = aws_apigatewayv2_api.Example.Id,\n DomainName = aws_apigatewayv2_domain_name.Example.Id,\n Stage = aws_apigatewayv2_stage.Example.Id,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := apigatewayv2.NewApiMapping(ctx, \"example\", \u0026apigatewayv2.ApiMappingArgs{\n\t\t\tApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id),\n\t\t\tDomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id),\n\t\t\tStage: pulumi.Any(aws_apigatewayv2_stage.Example.Id),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.apigatewayv2.ApiMapping;\nimport com.pulumi.aws.apigatewayv2.ApiMappingArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new ApiMapping(\"example\", ApiMappingArgs.builder() \n .apiId(aws_apigatewayv2_api.example().id())\n .domainName(aws_apigatewayv2_domain_name.example().id())\n .stage(aws_apigatewayv2_stage.example().id())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: aws:apigatewayv2:ApiMapping\n properties:\n apiId: ${aws_apigatewayv2_api.example.id}\n domainName: ${aws_apigatewayv2_domain_name.example.id}\n stage: ${aws_apigatewayv2_stage.example.id}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nUsing `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example:\n\n```sh\n $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com\n```\n ", - "properties": { - "apiMappingKey": { - "type": "string", - "description": "The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html).\n" - }, - "domainConfiguration": { - "$ref": "#/types/awsx:apigatewayv2:DomainConfiguration", - "plain": true, - "description": "Configuration of the domain name to create. Cannot be specified together with `domainId`." - }, - "domainId": { - "type": "string", - "description": "Identifier of an existing domain. Cannot be specified together with `domainConfiguration`." - }, - "stage": { - "type": "string", - "description": "API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage.\n" - } - }, - "type": "object", - "required": [ - "stage" - ] - }, "awsx:apigatewayv2:HttpAuthorizer": { "description": "Manages an Amazon API Gateway Version 2 authorizer.\nMore information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html).\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n### Basic WebSocket API\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst example = new aws.apigatewayv2.Authorizer(\"example\", {\n apiId: aws_apigatewayv2_api.example.id,\n authorizerType: \"REQUEST\",\n authorizerUri: aws_lambda_function.example.invoke_arn,\n identitySources: [\"route.request.header.Auth\"],\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nexample = aws.apigatewayv2.Authorizer(\"example\",\n api_id=aws_apigatewayv2_api[\"example\"][\"id\"],\n authorizer_type=\"REQUEST\",\n authorizer_uri=aws_lambda_function[\"example\"][\"invoke_arn\"],\n identity_sources=[\"route.request.header.Auth\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Aws.ApiGatewayV2.Authorizer(\"example\", new()\n {\n ApiId = aws_apigatewayv2_api.Example.Id,\n AuthorizerType = \"REQUEST\",\n AuthorizerUri = aws_lambda_function.Example.Invoke_arn,\n IdentitySources = new[]\n {\n \"route.request.header.Auth\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := apigatewayv2.NewAuthorizer(ctx, \"example\", \u0026apigatewayv2.AuthorizerArgs{\n\t\t\tApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id),\n\t\t\tAuthorizerType: pulumi.String(\"REQUEST\"),\n\t\t\tAuthorizerUri: pulumi.Any(aws_lambda_function.Example.Invoke_arn),\n\t\t\tIdentitySources: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"route.request.header.Auth\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.apigatewayv2.Authorizer;\nimport com.pulumi.aws.apigatewayv2.AuthorizerArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new Authorizer(\"example\", AuthorizerArgs.builder() \n .apiId(aws_apigatewayv2_api.example().id())\n .authorizerType(\"REQUEST\")\n .authorizerUri(aws_lambda_function.example().invoke_arn())\n .identitySources(\"route.request.header.Auth\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: aws:apigatewayv2:Authorizer\n properties:\n apiId: ${aws_apigatewayv2_api.example.id}\n authorizerType: REQUEST\n authorizerUri: ${aws_lambda_function.example.invoke_arn}\n identitySources:\n - route.request.header.Auth\n```\n{{% /example %}}\n{{% example %}}\n### Basic HTTP API\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\n\nconst example = new aws.apigatewayv2.Authorizer(\"example\", {\n apiId: aws_apigatewayv2_api.example.id,\n authorizerType: \"REQUEST\",\n authorizerUri: aws_lambda_function.example.invoke_arn,\n identitySources: [\"$request.header.Authorization\"],\n authorizerPayloadFormatVersion: \"2.0\",\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\n\nexample = aws.apigatewayv2.Authorizer(\"example\",\n api_id=aws_apigatewayv2_api[\"example\"][\"id\"],\n authorizer_type=\"REQUEST\",\n authorizer_uri=aws_lambda_function[\"example\"][\"invoke_arn\"],\n identity_sources=[\"$request.header.Authorization\"],\n authorizer_payload_format_version=\"2.0\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Aws.ApiGatewayV2.Authorizer(\"example\", new()\n {\n ApiId = aws_apigatewayv2_api.Example.Id,\n AuthorizerType = \"REQUEST\",\n AuthorizerUri = aws_lambda_function.Example.Invoke_arn,\n IdentitySources = new[]\n {\n \"$request.header.Authorization\",\n },\n AuthorizerPayloadFormatVersion = \"2.0\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := apigatewayv2.NewAuthorizer(ctx, \"example\", \u0026apigatewayv2.AuthorizerArgs{\n\t\t\tApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id),\n\t\t\tAuthorizerType: pulumi.String(\"REQUEST\"),\n\t\t\tAuthorizerUri: pulumi.Any(aws_lambda_function.Example.Invoke_arn),\n\t\t\tIdentitySources: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"$request.header.Authorization\"),\n\t\t\t},\n\t\t\tAuthorizerPayloadFormatVersion: pulumi.String(\"2.0\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.aws.apigatewayv2.Authorizer;\nimport com.pulumi.aws.apigatewayv2.AuthorizerArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new Authorizer(\"example\", AuthorizerArgs.builder() \n .apiId(aws_apigatewayv2_api.example().id())\n .authorizerType(\"REQUEST\")\n .authorizerUri(aws_lambda_function.example().invoke_arn())\n .identitySources(\"$request.header.Authorization\")\n .authorizerPayloadFormatVersion(\"2.0\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: aws:apigatewayv2:Authorizer\n properties:\n apiId: ${aws_apigatewayv2_api.example.id}\n authorizerType: REQUEST\n authorizerUri: ${aws_lambda_function.example.invoke_arn}\n identitySources:\n - $request.header.Authorization\n authorizerPayloadFormatVersion: '2.0'\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nUsing `pulumi import`, import `aws_apigatewayv2_authorizer` using the API identifier and authorizer identifier. For example:\n\n```sh\n $ pulumi import aws:apigatewayv2/authorizer:Authorizer example aabbccddee/1122334\n```\n ", "properties": { diff --git a/schemagen/pkg/gen/apigatewayv2.go b/schemagen/pkg/gen/apigatewayv2.go index d3d9d2fca..32704b395 100644 --- a/schemagen/pkg/gen/apigatewayv2.go +++ b/schemagen/pkg/gen/apigatewayv2.go @@ -22,12 +22,12 @@ func generateApiGatewayV2(awsSpec schema.PackageSpec) schema.PackageSpec { "awsx:apigatewayv2:HttpApi": httpApi(awsSpec), }, Types: map[string]schema.ComplexTypeSpec{ - "awsx:apigatewayv2:HttpRoute": httpRoute(awsSpec), - "awsx:apigatewayv2:HttpIntegration": httpIntegration(awsSpec), - "awsx:apigatewayv2:HttpAuthorizer": httpAuthorizer(awsSpec), - "awsx:apigatewayv2:HttpStage": httpStage(awsSpec), - "awsx:apigatewayv2:DomainMapping": domainMapping(awsSpec), - "awsx:apigatewayv2:DomainConfiguration": domainConfiguration(awsSpec), + "awsx:apigatewayv2:HttpRoute": httpRoute(awsSpec), + "awsx:apigatewayv2:HttpIntegration": httpIntegration(awsSpec), + "awsx:apigatewayv2:HttpAuthorizer": httpAuthorizer(awsSpec), + "awsx:apigatewayv2:HttpStage": httpStage(awsSpec), + "awsx:apigatewayv2:DomainMapping": domainMapping(awsSpec), + "awsx:apigatewayv2:DomainName": domainName(awsSpec), }, } } @@ -221,16 +221,16 @@ func domainMapping(awsSpec schema.PackageSpec) schema.ComplexTypeSpec { original := awsSpec.Resources["aws:apigatewayv2/apiMapping:ApiMapping"] properties := renameAwsPropertiesRefs(awsSpec, original.InputProperties) delete(properties, "apiId") - delete(properties, "domainName") - properties["domainConfiguration"] = schema.PropertySpec{ + delete(properties, "domainName") // Inferred from the map key + properties["domainName"] = schema.PropertySpec{ Description: "Configuration of the domain name to create. Cannot be specified together with `domainId`.", TypeSpec: schema.TypeSpec{ - Ref: localRef("apigatewayv2", "DomainConfiguration"), + Ref: localRef("apigatewayv2", "DomainName"), Plain: true, }, } properties["domainId"] = schema.PropertySpec{ - Description: "Identifier of an existing domain. Cannot be specified together with `domainConfiguration`.", + Description: "Identifier of an existing domain. Cannot be specified together with `DomainName`.", TypeSpec: schema.TypeSpec{ Type: "string", }, @@ -245,7 +245,7 @@ func domainMapping(awsSpec schema.PackageSpec) schema.ComplexTypeSpec { } } -func domainConfiguration(awsSpec schema.PackageSpec) schema.ComplexTypeSpec { +func domainName(awsSpec schema.PackageSpec) schema.ComplexTypeSpec { original := awsSpec.Resources["aws:apigatewayv2/domainName:DomainName"] properties := renameAwsPropertiesRefs(awsSpec, original.InputProperties) delete(properties, "domainName") diff --git a/sdk/dotnet/Apigatewayv2/Inputs/DomainMappingArgs.cs b/sdk/dotnet/Apigatewayv2/Inputs/DomainMappingArgs.cs index c9f766922..14473e724 100644 --- a/sdk/dotnet/Apigatewayv2/Inputs/DomainMappingArgs.cs +++ b/sdk/dotnet/Apigatewayv2/Inputs/DomainMappingArgs.cs @@ -137,16 +137,16 @@ public sealed class DomainMappingArgs : global::Pulumi.ResourceArgs public Input? ApiMappingKey { get; set; } /// - /// Configuration of the domain name to create. Cannot be specified together with `domainId`. + /// Identifier of an existing domain. Cannot be specified together with `DomainName`. /// - [Input("domainConfiguration")] - public Inputs.DomainConfigurationArgs? DomainConfiguration { get; set; } + [Input("domainId")] + public Input? DomainId { get; set; } /// - /// Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + /// Configuration of the domain name to create. Cannot be specified together with `domainId`. /// - [Input("domainId")] - public Input? DomainId { get; set; } + [Input("domainName")] + public Inputs.DomainNameArgs? DomainName { get; set; } /// /// API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. diff --git a/sdk/dotnet/Apigatewayv2/Inputs/DomainConfigurationArgs.cs b/sdk/dotnet/Apigatewayv2/Inputs/DomainNameArgs.cs similarity index 98% rename from sdk/dotnet/Apigatewayv2/Inputs/DomainConfigurationArgs.cs rename to sdk/dotnet/Apigatewayv2/Inputs/DomainNameArgs.cs index 4f65c282e..f20f7d2d1 100644 --- a/sdk/dotnet/Apigatewayv2/Inputs/DomainConfigurationArgs.cs +++ b/sdk/dotnet/Apigatewayv2/Inputs/DomainNameArgs.cs @@ -349,7 +349,7 @@ namespace Pulumi.Awsx.Apigatewayv2.Inputs /// ``` /// /// - public sealed class DomainConfigurationArgs : global::Pulumi.ResourceArgs + public sealed class DomainNameArgs : global::Pulumi.ResourceArgs { /// /// Domain name configuration. See below. @@ -375,9 +375,9 @@ public InputMap Tags set => _tags = value; } - public DomainConfigurationArgs() + public DomainNameArgs() { } - public static new DomainConfigurationArgs Empty => new DomainConfigurationArgs(); + public static new DomainNameArgs Empty => new DomainNameArgs(); } } diff --git a/sdk/go/awsx/apigatewayv2/pulumiTypes.go b/sdk/go/awsx/apigatewayv2/pulumiTypes.go index daa5c0899..7de30fe06 100644 --- a/sdk/go/awsx/apigatewayv2/pulumiTypes.go +++ b/sdk/go/awsx/apigatewayv2/pulumiTypes.go @@ -15,6 +15,217 @@ import ( var _ = internal.GetEnvOrDefault +// Manages an Amazon API Gateway Version 2 API mapping. +// More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). +// +// ## Example Usage +// ### Basic +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ +// ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), +// DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), +// Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: +// +// ```sh +// +// $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com +// +// ``` +type DomainMapping struct { + // The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). + ApiMappingKey *string `pulumi:"apiMappingKey"` + // Identifier of an existing domain. Cannot be specified together with `DomainName`. + DomainId *string `pulumi:"domainId"` + // Configuration of the domain name to create. Cannot be specified together with `domainId`. + DomainName *DomainName `pulumi:"domainName"` + // API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. + Stage string `pulumi:"stage"` +} + +// DomainMappingInput is an input type that accepts DomainMappingArgs and DomainMappingOutput values. +// You can construct a concrete instance of `DomainMappingInput` via: +// +// DomainMappingArgs{...} +type DomainMappingInput interface { + pulumi.Input + + ToDomainMappingOutput() DomainMappingOutput + ToDomainMappingOutputWithContext(context.Context) DomainMappingOutput +} + +// Manages an Amazon API Gateway Version 2 API mapping. +// More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). +// +// ## Example Usage +// ### Basic +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ +// ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), +// DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), +// Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: +// +// ```sh +// +// $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com +// +// ``` +type DomainMappingArgs struct { + // The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). + ApiMappingKey pulumi.StringPtrInput `pulumi:"apiMappingKey"` + // Identifier of an existing domain. Cannot be specified together with `DomainName`. + DomainId pulumi.StringPtrInput `pulumi:"domainId"` + // Configuration of the domain name to create. Cannot be specified together with `domainId`. + DomainName *DomainNameArgs `pulumi:"domainName"` + // API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. + Stage pulumi.StringInput `pulumi:"stage"` +} + +func (DomainMappingArgs) ElementType() reflect.Type { + return reflect.TypeOf((*DomainMapping)(nil)).Elem() +} + +func (i DomainMappingArgs) ToDomainMappingOutput() DomainMappingOutput { + return i.ToDomainMappingOutputWithContext(context.Background()) +} + +func (i DomainMappingArgs) ToDomainMappingOutputWithContext(ctx context.Context) DomainMappingOutput { + return pulumi.ToOutputWithContext(ctx, i).(DomainMappingOutput) +} + +func (i DomainMappingArgs) ToOutput(ctx context.Context) pulumix.Output[DomainMapping] { + return pulumix.Output[DomainMapping]{ + OutputState: i.ToDomainMappingOutputWithContext(ctx).OutputState, + } +} + +// Manages an Amazon API Gateway Version 2 API mapping. +// More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). +// +// ## Example Usage +// ### Basic +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ +// ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), +// DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), +// Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: +// +// ```sh +// +// $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com +// +// ``` +type DomainMappingOutput struct{ *pulumi.OutputState } + +func (DomainMappingOutput) ElementType() reflect.Type { + return reflect.TypeOf((*DomainMapping)(nil)).Elem() +} + +func (o DomainMappingOutput) ToDomainMappingOutput() DomainMappingOutput { + return o +} + +func (o DomainMappingOutput) ToDomainMappingOutputWithContext(ctx context.Context) DomainMappingOutput { + return o +} + +func (o DomainMappingOutput) ToOutput(ctx context.Context) pulumix.Output[DomainMapping] { + return pulumix.Output[DomainMapping]{ + OutputState: o.OutputState, + } +} + +// The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). +func (o DomainMappingOutput) ApiMappingKey() pulumi.StringPtrOutput { + return o.ApplyT(func(v DomainMapping) *string { return v.ApiMappingKey }).(pulumi.StringPtrOutput) +} + +// Identifier of an existing domain. Cannot be specified together with `DomainName`. +func (o DomainMappingOutput) DomainId() pulumi.StringPtrOutput { + return o.ApplyT(func(v DomainMapping) *string { return v.DomainId }).(pulumi.StringPtrOutput) +} + +// Configuration of the domain name to create. Cannot be specified together with `domainId`. +func (o DomainMappingOutput) DomainName() DomainNamePtrOutput { + return o.ApplyT(func(v DomainMapping) *DomainName { return v.DomainName }).(DomainNamePtrOutput) +} + +// API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. +func (o DomainMappingOutput) Stage() pulumi.StringOutput { + return o.ApplyT(func(v DomainMapping) string { return v.Stage }).(pulumi.StringOutput) +} + // Manages an Amazon API Gateway Version 2 domain name. // More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). // @@ -110,7 +321,7 @@ var _ = internal.GetEnvOrDefault // $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com // // ``` -type DomainConfiguration struct { +type DomainName struct { // Domain name configuration. See below. DomainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration `pulumi:"domainNameConfiguration"` // Mutual TLS authentication configuration for the domain name. @@ -119,15 +330,15 @@ type DomainConfiguration struct { Tags map[string]string `pulumi:"tags"` } -// DomainConfigurationInput is an input type that accepts DomainConfigurationArgs and DomainConfigurationOutput values. -// You can construct a concrete instance of `DomainConfigurationInput` via: +// DomainNameInput is an input type that accepts DomainNameArgs and DomainNameOutput values. +// You can construct a concrete instance of `DomainNameInput` via: // -// DomainConfigurationArgs{...} -type DomainConfigurationInput interface { +// DomainNameArgs{...} +type DomainNameInput interface { pulumi.Input - ToDomainConfigurationOutput() DomainConfigurationOutput - ToDomainConfigurationOutputWithContext(context.Context) DomainConfigurationOutput + ToDomainNameOutput() DomainNameOutput + ToDomainNameOutputWithContext(context.Context) DomainNameOutput } // Manages an Amazon API Gateway Version 2 domain name. @@ -225,7 +436,7 @@ type DomainConfigurationInput interface { // $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com // // ``` -type DomainConfigurationArgs struct { +type DomainNameArgs struct { // Domain name configuration. See below. DomainNameConfiguration apigatewayv2.DomainNameDomainNameConfigurationInput `pulumi:"domainNameConfiguration"` // Mutual TLS authentication configuration for the domain name. @@ -234,68 +445,68 @@ type DomainConfigurationArgs struct { Tags pulumi.StringMapInput `pulumi:"tags"` } -func (DomainConfigurationArgs) ElementType() reflect.Type { - return reflect.TypeOf((*DomainConfiguration)(nil)).Elem() +func (DomainNameArgs) ElementType() reflect.Type { + return reflect.TypeOf((*DomainName)(nil)).Elem() } -func (i DomainConfigurationArgs) ToDomainConfigurationOutput() DomainConfigurationOutput { - return i.ToDomainConfigurationOutputWithContext(context.Background()) +func (i DomainNameArgs) ToDomainNameOutput() DomainNameOutput { + return i.ToDomainNameOutputWithContext(context.Background()) } -func (i DomainConfigurationArgs) ToDomainConfigurationOutputWithContext(ctx context.Context) DomainConfigurationOutput { - return pulumi.ToOutputWithContext(ctx, i).(DomainConfigurationOutput) +func (i DomainNameArgs) ToDomainNameOutputWithContext(ctx context.Context) DomainNameOutput { + return pulumi.ToOutputWithContext(ctx, i).(DomainNameOutput) } -func (i DomainConfigurationArgs) ToOutput(ctx context.Context) pulumix.Output[DomainConfiguration] { - return pulumix.Output[DomainConfiguration]{ - OutputState: i.ToDomainConfigurationOutputWithContext(ctx).OutputState, +func (i DomainNameArgs) ToOutput(ctx context.Context) pulumix.Output[DomainName] { + return pulumix.Output[DomainName]{ + OutputState: i.ToDomainNameOutputWithContext(ctx).OutputState, } } -func (i DomainConfigurationArgs) ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput { - return i.ToDomainConfigurationPtrOutputWithContext(context.Background()) +func (i DomainNameArgs) ToDomainNamePtrOutput() DomainNamePtrOutput { + return i.ToDomainNamePtrOutputWithContext(context.Background()) } -func (i DomainConfigurationArgs) ToDomainConfigurationPtrOutputWithContext(ctx context.Context) DomainConfigurationPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(DomainConfigurationOutput).ToDomainConfigurationPtrOutputWithContext(ctx) +func (i DomainNameArgs) ToDomainNamePtrOutputWithContext(ctx context.Context) DomainNamePtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(DomainNameOutput).ToDomainNamePtrOutputWithContext(ctx) } -// DomainConfigurationPtrInput is an input type that accepts DomainConfigurationArgs, DomainConfigurationPtr and DomainConfigurationPtrOutput values. -// You can construct a concrete instance of `DomainConfigurationPtrInput` via: +// DomainNamePtrInput is an input type that accepts DomainNameArgs, DomainNamePtr and DomainNamePtrOutput values. +// You can construct a concrete instance of `DomainNamePtrInput` via: // -// DomainConfigurationArgs{...} +// DomainNameArgs{...} // // or: // // nil -type DomainConfigurationPtrInput interface { +type DomainNamePtrInput interface { pulumi.Input - ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput - ToDomainConfigurationPtrOutputWithContext(context.Context) DomainConfigurationPtrOutput + ToDomainNamePtrOutput() DomainNamePtrOutput + ToDomainNamePtrOutputWithContext(context.Context) DomainNamePtrOutput } -type domainConfigurationPtrType DomainConfigurationArgs +type domainNamePtrType DomainNameArgs -func DomainConfigurationPtr(v *DomainConfigurationArgs) DomainConfigurationPtrInput { - return (*domainConfigurationPtrType)(v) +func DomainNamePtr(v *DomainNameArgs) DomainNamePtrInput { + return (*domainNamePtrType)(v) } -func (*domainConfigurationPtrType) ElementType() reflect.Type { - return reflect.TypeOf((**DomainConfiguration)(nil)).Elem() +func (*domainNamePtrType) ElementType() reflect.Type { + return reflect.TypeOf((**DomainName)(nil)).Elem() } -func (i *domainConfigurationPtrType) ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput { - return i.ToDomainConfigurationPtrOutputWithContext(context.Background()) +func (i *domainNamePtrType) ToDomainNamePtrOutput() DomainNamePtrOutput { + return i.ToDomainNamePtrOutputWithContext(context.Background()) } -func (i *domainConfigurationPtrType) ToDomainConfigurationPtrOutputWithContext(ctx context.Context) DomainConfigurationPtrOutput { - return pulumi.ToOutputWithContext(ctx, i).(DomainConfigurationPtrOutput) +func (i *domainNamePtrType) ToDomainNamePtrOutputWithContext(ctx context.Context) DomainNamePtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(DomainNamePtrOutput) } -func (i *domainConfigurationPtrType) ToOutput(ctx context.Context) pulumix.Output[*DomainConfiguration] { - return pulumix.Output[*DomainConfiguration]{ - OutputState: i.ToDomainConfigurationPtrOutputWithContext(ctx).OutputState, +func (i *domainNamePtrType) ToOutput(ctx context.Context) pulumix.Output[*DomainName] { + return pulumix.Output[*DomainName]{ + OutputState: i.ToDomainNamePtrOutputWithContext(ctx).OutputState, } } @@ -394,88 +605,84 @@ func (i *domainConfigurationPtrType) ToOutput(ctx context.Context) pulumix.Outpu // $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com // // ``` -type DomainConfigurationOutput struct{ *pulumi.OutputState } +type DomainNameOutput struct{ *pulumi.OutputState } -func (DomainConfigurationOutput) ElementType() reflect.Type { - return reflect.TypeOf((*DomainConfiguration)(nil)).Elem() +func (DomainNameOutput) ElementType() reflect.Type { + return reflect.TypeOf((*DomainName)(nil)).Elem() } -func (o DomainConfigurationOutput) ToDomainConfigurationOutput() DomainConfigurationOutput { +func (o DomainNameOutput) ToDomainNameOutput() DomainNameOutput { return o } -func (o DomainConfigurationOutput) ToDomainConfigurationOutputWithContext(ctx context.Context) DomainConfigurationOutput { +func (o DomainNameOutput) ToDomainNameOutputWithContext(ctx context.Context) DomainNameOutput { return o } -func (o DomainConfigurationOutput) ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput { - return o.ToDomainConfigurationPtrOutputWithContext(context.Background()) +func (o DomainNameOutput) ToDomainNamePtrOutput() DomainNamePtrOutput { + return o.ToDomainNamePtrOutputWithContext(context.Background()) } -func (o DomainConfigurationOutput) ToDomainConfigurationPtrOutputWithContext(ctx context.Context) DomainConfigurationPtrOutput { - return o.ApplyTWithContext(ctx, func(_ context.Context, v DomainConfiguration) *DomainConfiguration { +func (o DomainNameOutput) ToDomainNamePtrOutputWithContext(ctx context.Context) DomainNamePtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v DomainName) *DomainName { return &v - }).(DomainConfigurationPtrOutput) + }).(DomainNamePtrOutput) } -func (o DomainConfigurationOutput) ToOutput(ctx context.Context) pulumix.Output[DomainConfiguration] { - return pulumix.Output[DomainConfiguration]{ +func (o DomainNameOutput) ToOutput(ctx context.Context) pulumix.Output[DomainName] { + return pulumix.Output[DomainName]{ OutputState: o.OutputState, } } // Domain name configuration. See below. -func (o DomainConfigurationOutput) DomainNameConfiguration() apigatewayv2.DomainNameDomainNameConfigurationOutput { - return o.ApplyT(func(v DomainConfiguration) apigatewayv2.DomainNameDomainNameConfiguration { - return v.DomainNameConfiguration - }).(apigatewayv2.DomainNameDomainNameConfigurationOutput) +func (o DomainNameOutput) DomainNameConfiguration() apigatewayv2.DomainNameDomainNameConfigurationOutput { + return o.ApplyT(func(v DomainName) apigatewayv2.DomainNameDomainNameConfiguration { return v.DomainNameConfiguration }).(apigatewayv2.DomainNameDomainNameConfigurationOutput) } // Mutual TLS authentication configuration for the domain name. -func (o DomainConfigurationOutput) MutualTlsAuthentication() apigatewayv2.DomainNameMutualTlsAuthenticationPtrOutput { - return o.ApplyT(func(v DomainConfiguration) *apigatewayv2.DomainNameMutualTlsAuthentication { - return v.MutualTlsAuthentication - }).(apigatewayv2.DomainNameMutualTlsAuthenticationPtrOutput) +func (o DomainNameOutput) MutualTlsAuthentication() apigatewayv2.DomainNameMutualTlsAuthenticationPtrOutput { + return o.ApplyT(func(v DomainName) *apigatewayv2.DomainNameMutualTlsAuthentication { return v.MutualTlsAuthentication }).(apigatewayv2.DomainNameMutualTlsAuthenticationPtrOutput) } // Map of tags to assign to the domain name. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. -func (o DomainConfigurationOutput) Tags() pulumi.StringMapOutput { - return o.ApplyT(func(v DomainConfiguration) map[string]string { return v.Tags }).(pulumi.StringMapOutput) +func (o DomainNameOutput) Tags() pulumi.StringMapOutput { + return o.ApplyT(func(v DomainName) map[string]string { return v.Tags }).(pulumi.StringMapOutput) } -type DomainConfigurationPtrOutput struct{ *pulumi.OutputState } +type DomainNamePtrOutput struct{ *pulumi.OutputState } -func (DomainConfigurationPtrOutput) ElementType() reflect.Type { - return reflect.TypeOf((**DomainConfiguration)(nil)).Elem() +func (DomainNamePtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**DomainName)(nil)).Elem() } -func (o DomainConfigurationPtrOutput) ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput { +func (o DomainNamePtrOutput) ToDomainNamePtrOutput() DomainNamePtrOutput { return o } -func (o DomainConfigurationPtrOutput) ToDomainConfigurationPtrOutputWithContext(ctx context.Context) DomainConfigurationPtrOutput { +func (o DomainNamePtrOutput) ToDomainNamePtrOutputWithContext(ctx context.Context) DomainNamePtrOutput { return o } -func (o DomainConfigurationPtrOutput) ToOutput(ctx context.Context) pulumix.Output[*DomainConfiguration] { - return pulumix.Output[*DomainConfiguration]{ +func (o DomainNamePtrOutput) ToOutput(ctx context.Context) pulumix.Output[*DomainName] { + return pulumix.Output[*DomainName]{ OutputState: o.OutputState, } } -func (o DomainConfigurationPtrOutput) Elem() DomainConfigurationOutput { - return o.ApplyT(func(v *DomainConfiguration) DomainConfiguration { +func (o DomainNamePtrOutput) Elem() DomainNameOutput { + return o.ApplyT(func(v *DomainName) DomainName { if v != nil { return *v } - var ret DomainConfiguration + var ret DomainName return ret - }).(DomainConfigurationOutput) + }).(DomainNameOutput) } // Domain name configuration. See below. -func (o DomainConfigurationPtrOutput) DomainNameConfiguration() apigatewayv2.DomainNameDomainNameConfigurationPtrOutput { - return o.ApplyT(func(v *DomainConfiguration) *apigatewayv2.DomainNameDomainNameConfiguration { +func (o DomainNamePtrOutput) DomainNameConfiguration() apigatewayv2.DomainNameDomainNameConfigurationPtrOutput { + return o.ApplyT(func(v *DomainName) *apigatewayv2.DomainNameDomainNameConfiguration { if v == nil { return nil } @@ -484,8 +691,8 @@ func (o DomainConfigurationPtrOutput) DomainNameConfiguration() apigatewayv2.Dom } // Mutual TLS authentication configuration for the domain name. -func (o DomainConfigurationPtrOutput) MutualTlsAuthentication() apigatewayv2.DomainNameMutualTlsAuthenticationPtrOutput { - return o.ApplyT(func(v *DomainConfiguration) *apigatewayv2.DomainNameMutualTlsAuthentication { +func (o DomainNamePtrOutput) MutualTlsAuthentication() apigatewayv2.DomainNameMutualTlsAuthenticationPtrOutput { + return o.ApplyT(func(v *DomainName) *apigatewayv2.DomainNameMutualTlsAuthentication { if v == nil { return nil } @@ -494,8 +701,8 @@ func (o DomainConfigurationPtrOutput) MutualTlsAuthentication() apigatewayv2.Dom } // Map of tags to assign to the domain name. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. -func (o DomainConfigurationPtrOutput) Tags() pulumi.StringMapOutput { - return o.ApplyT(func(v *DomainConfiguration) map[string]string { +func (o DomainNamePtrOutput) Tags() pulumi.StringMapOutput { + return o.ApplyT(func(v *DomainName) map[string]string { if v == nil { return nil } @@ -503,217 +710,6 @@ func (o DomainConfigurationPtrOutput) Tags() pulumi.StringMapOutput { }).(pulumi.StringMapOutput) } -// Manages an Amazon API Gateway Version 2 API mapping. -// More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). -// -// ## Example Usage -// ### Basic -// ```go -// package main -// -// import ( -// -// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" -// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -// -// ) -// -// func main() { -// pulumi.Run(func(ctx *pulumi.Context) error { -// _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ -// ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), -// DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), -// Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), -// }) -// if err != nil { -// return err -// } -// return nil -// }) -// } -// -// ``` -// -// ## Import -// -// Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: -// -// ```sh -// -// $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com -// -// ``` -type DomainMapping struct { - // The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). - ApiMappingKey *string `pulumi:"apiMappingKey"` - // Configuration of the domain name to create. Cannot be specified together with `domainId`. - DomainConfiguration *DomainConfiguration `pulumi:"domainConfiguration"` - // Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. - DomainId *string `pulumi:"domainId"` - // API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. - Stage string `pulumi:"stage"` -} - -// DomainMappingInput is an input type that accepts DomainMappingArgs and DomainMappingOutput values. -// You can construct a concrete instance of `DomainMappingInput` via: -// -// DomainMappingArgs{...} -type DomainMappingInput interface { - pulumi.Input - - ToDomainMappingOutput() DomainMappingOutput - ToDomainMappingOutputWithContext(context.Context) DomainMappingOutput -} - -// Manages an Amazon API Gateway Version 2 API mapping. -// More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). -// -// ## Example Usage -// ### Basic -// ```go -// package main -// -// import ( -// -// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" -// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -// -// ) -// -// func main() { -// pulumi.Run(func(ctx *pulumi.Context) error { -// _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ -// ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), -// DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), -// Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), -// }) -// if err != nil { -// return err -// } -// return nil -// }) -// } -// -// ``` -// -// ## Import -// -// Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: -// -// ```sh -// -// $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com -// -// ``` -type DomainMappingArgs struct { - // The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). - ApiMappingKey pulumi.StringPtrInput `pulumi:"apiMappingKey"` - // Configuration of the domain name to create. Cannot be specified together with `domainId`. - DomainConfiguration *DomainConfigurationArgs `pulumi:"domainConfiguration"` - // Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. - DomainId pulumi.StringPtrInput `pulumi:"domainId"` - // API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. - Stage pulumi.StringInput `pulumi:"stage"` -} - -func (DomainMappingArgs) ElementType() reflect.Type { - return reflect.TypeOf((*DomainMapping)(nil)).Elem() -} - -func (i DomainMappingArgs) ToDomainMappingOutput() DomainMappingOutput { - return i.ToDomainMappingOutputWithContext(context.Background()) -} - -func (i DomainMappingArgs) ToDomainMappingOutputWithContext(ctx context.Context) DomainMappingOutput { - return pulumi.ToOutputWithContext(ctx, i).(DomainMappingOutput) -} - -func (i DomainMappingArgs) ToOutput(ctx context.Context) pulumix.Output[DomainMapping] { - return pulumix.Output[DomainMapping]{ - OutputState: i.ToDomainMappingOutputWithContext(ctx).OutputState, - } -} - -// Manages an Amazon API Gateway Version 2 API mapping. -// More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). -// -// ## Example Usage -// ### Basic -// ```go -// package main -// -// import ( -// -// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" -// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -// -// ) -// -// func main() { -// pulumi.Run(func(ctx *pulumi.Context) error { -// _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ -// ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), -// DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), -// Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), -// }) -// if err != nil { -// return err -// } -// return nil -// }) -// } -// -// ``` -// -// ## Import -// -// Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: -// -// ```sh -// -// $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com -// -// ``` -type DomainMappingOutput struct{ *pulumi.OutputState } - -func (DomainMappingOutput) ElementType() reflect.Type { - return reflect.TypeOf((*DomainMapping)(nil)).Elem() -} - -func (o DomainMappingOutput) ToDomainMappingOutput() DomainMappingOutput { - return o -} - -func (o DomainMappingOutput) ToDomainMappingOutputWithContext(ctx context.Context) DomainMappingOutput { - return o -} - -func (o DomainMappingOutput) ToOutput(ctx context.Context) pulumix.Output[DomainMapping] { - return pulumix.Output[DomainMapping]{ - OutputState: o.OutputState, - } -} - -// The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). -func (o DomainMappingOutput) ApiMappingKey() pulumi.StringPtrOutput { - return o.ApplyT(func(v DomainMapping) *string { return v.ApiMappingKey }).(pulumi.StringPtrOutput) -} - -// Configuration of the domain name to create. Cannot be specified together with `domainId`. -func (o DomainMappingOutput) DomainConfiguration() DomainConfigurationPtrOutput { - return o.ApplyT(func(v DomainMapping) *DomainConfiguration { return v.DomainConfiguration }).(DomainConfigurationPtrOutput) -} - -// Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. -func (o DomainMappingOutput) DomainId() pulumi.StringPtrOutput { - return o.ApplyT(func(v DomainMapping) *string { return v.DomainId }).(pulumi.StringPtrOutput) -} - -// API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. -func (o DomainMappingOutput) Stage() pulumi.StringOutput { - return o.ApplyT(func(v DomainMapping) string { return v.Stage }).(pulumi.StringOutput) -} - // Manages an Amazon API Gateway Version 2 authorizer. // More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html). // @@ -2952,18 +2948,18 @@ func (o HttpStageOutput) Tags() pulumi.StringMapOutput { } func init() { - pulumi.RegisterInputType(reflect.TypeOf((*DomainConfigurationInput)(nil)).Elem(), DomainConfigurationArgs{}) - pulumi.RegisterInputType(reflect.TypeOf((*DomainConfigurationPtrInput)(nil)).Elem(), DomainConfigurationArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*DomainMappingInput)(nil)).Elem(), DomainMappingArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*DomainNameInput)(nil)).Elem(), DomainNameArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*DomainNamePtrInput)(nil)).Elem(), DomainNameArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*HttpAuthorizerInput)(nil)).Elem(), HttpAuthorizerArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*HttpAuthorizerPtrInput)(nil)).Elem(), HttpAuthorizerArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*HttpIntegrationInput)(nil)).Elem(), HttpIntegrationArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*HttpIntegrationPtrInput)(nil)).Elem(), HttpIntegrationArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*HttpRouteInput)(nil)).Elem(), HttpRouteArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*HttpStageInput)(nil)).Elem(), HttpStageArgs{}) - pulumi.RegisterOutputType(DomainConfigurationOutput{}) - pulumi.RegisterOutputType(DomainConfigurationPtrOutput{}) pulumi.RegisterOutputType(DomainMappingOutput{}) + pulumi.RegisterOutputType(DomainNameOutput{}) + pulumi.RegisterOutputType(DomainNamePtrOutput{}) pulumi.RegisterOutputType(HttpAuthorizerOutput{}) pulumi.RegisterOutputType(HttpAuthorizerPtrOutput{}) pulumi.RegisterOutputType(HttpIntegrationOutput{}) diff --git a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainMappingArgs.java b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainMappingArgs.java index 5f70428e5..88b7528e8 100644 --- a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainMappingArgs.java +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainMappingArgs.java @@ -3,7 +3,7 @@ package com.pulumi.awsx.apigatewayv2.inputs; -import com.pulumi.awsx.apigatewayv2.inputs.DomainConfigurationArgs; +import com.pulumi.awsx.apigatewayv2.inputs.DomainNameArgs; import com.pulumi.core.Output; import com.pulumi.core.annotations.Import; import java.lang.String; @@ -78,33 +78,33 @@ public Optional> apiMappingKey() { } /** - * Configuration of the domain name to create. Cannot be specified together with `domainId`. + * Identifier of an existing domain. Cannot be specified together with `DomainName`. * */ - @Import(name="domainConfiguration") - private @Nullable DomainConfigurationArgs domainConfiguration; + @Import(name="domainId") + private @Nullable Output domainId; /** - * @return Configuration of the domain name to create. Cannot be specified together with `domainId`. + * @return Identifier of an existing domain. Cannot be specified together with `DomainName`. * */ - public Optional domainConfiguration() { - return Optional.ofNullable(this.domainConfiguration); + public Optional> domainId() { + return Optional.ofNullable(this.domainId); } /** - * Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + * Configuration of the domain name to create. Cannot be specified together with `domainId`. * */ - @Import(name="domainId") - private @Nullable Output domainId; + @Import(name="domainName") + private @Nullable DomainNameArgs domainName; /** - * @return Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + * @return Configuration of the domain name to create. Cannot be specified together with `domainId`. * */ - public Optional> domainId() { - return Optional.ofNullable(this.domainId); + public Optional domainName() { + return Optional.ofNullable(this.domainName); } /** @@ -126,8 +126,8 @@ private DomainMappingArgs() {} private DomainMappingArgs(DomainMappingArgs $) { this.apiMappingKey = $.apiMappingKey; - this.domainConfiguration = $.domainConfiguration; this.domainId = $.domainId; + this.domainName = $.domainName; this.stage = $.stage; } @@ -171,35 +171,35 @@ public Builder apiMappingKey(String apiMappingKey) { } /** - * @param domainConfiguration Configuration of the domain name to create. Cannot be specified together with `domainId`. + * @param domainId Identifier of an existing domain. Cannot be specified together with `DomainName`. * * @return builder * */ - public Builder domainConfiguration(@Nullable DomainConfigurationArgs domainConfiguration) { - $.domainConfiguration = domainConfiguration; + public Builder domainId(@Nullable Output domainId) { + $.domainId = domainId; return this; } /** - * @param domainId Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + * @param domainId Identifier of an existing domain. Cannot be specified together with `DomainName`. * * @return builder * */ - public Builder domainId(@Nullable Output domainId) { - $.domainId = domainId; - return this; + public Builder domainId(String domainId) { + return domainId(Output.of(domainId)); } /** - * @param domainId Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + * @param domainName Configuration of the domain name to create. Cannot be specified together with `domainId`. * * @return builder * */ - public Builder domainId(String domainId) { - return domainId(Output.of(domainId)); + public Builder domainName(@Nullable DomainNameArgs domainName) { + $.domainName = domainName; + return this; } /** diff --git a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainConfigurationArgs.java b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainNameArgs.java similarity index 93% rename from sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainConfigurationArgs.java rename to sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainNameArgs.java index e047717fa..ee3f30c8b 100644 --- a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainConfigurationArgs.java +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainNameArgs.java @@ -116,9 +116,9 @@ * ``` * */ -public final class DomainConfigurationArgs extends com.pulumi.resources.ResourceArgs { +public final class DomainNameArgs extends com.pulumi.resources.ResourceArgs { - public static final DomainConfigurationArgs Empty = new DomainConfigurationArgs(); + public static final DomainNameArgs Empty = new DomainNameArgs(); /** * Domain name configuration. See below. @@ -165,9 +165,9 @@ public Optional>> tags() { return Optional.ofNullable(this.tags); } - private DomainConfigurationArgs() {} + private DomainNameArgs() {} - private DomainConfigurationArgs(DomainConfigurationArgs $) { + private DomainNameArgs(DomainNameArgs $) { this.domainNameConfiguration = $.domainNameConfiguration; this.mutualTlsAuthentication = $.mutualTlsAuthentication; this.tags = $.tags; @@ -176,19 +176,19 @@ private DomainConfigurationArgs(DomainConfigurationArgs $) { public static Builder builder() { return new Builder(); } - public static Builder builder(DomainConfigurationArgs defaults) { + public static Builder builder(DomainNameArgs defaults) { return new Builder(defaults); } public static final class Builder { - private DomainConfigurationArgs $; + private DomainNameArgs $; public Builder() { - $ = new DomainConfigurationArgs(); + $ = new DomainNameArgs(); } - public Builder(DomainConfigurationArgs defaults) { - $ = new DomainConfigurationArgs(Objects.requireNonNull(defaults)); + public Builder(DomainNameArgs defaults) { + $ = new DomainNameArgs(Objects.requireNonNull(defaults)); } /** @@ -254,7 +254,7 @@ public Builder tags(Map tags) { return tags(Output.of(tags)); } - public DomainConfigurationArgs build() { + public DomainNameArgs build() { $.domainNameConfiguration = Objects.requireNonNull($.domainNameConfiguration, "expected parameter 'domainNameConfiguration' to be non-null"); return $; } diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index 71ba84c60..8434bbd6b 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -10,6 +10,143 @@ import * as pulumiAws from "@pulumi/aws"; import * as utilities from "../utilities"; export namespace apigatewayv2 { + /** + * Manages an Amazon API Gateway Version 2 API mapping. + * More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). + * + * {{% examples %}} + * ## Example Usage + * {{% example %}} + * ### Basic + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as aws from "@pulumi/aws"; + * + * const example = new aws.apigatewayv2.ApiMapping("example", { + * apiId: aws_apigatewayv2_api.example.id, + * domainName: aws_apigatewayv2_domain_name.example.id, + * stage: aws_apigatewayv2_stage.example.id, + * }); + * ``` + * ```python + * import pulumi + * import pulumi_aws as aws + * + * example = aws.apigatewayv2.ApiMapping("example", + * api_id=aws_apigatewayv2_api["example"]["id"], + * domain_name=aws_apigatewayv2_domain_name["example"]["id"], + * stage=aws_apigatewayv2_stage["example"]["id"]) + * ``` + * ```csharp + * using System.Collections.Generic; + * using System.Linq; + * using Pulumi; + * using Aws = Pulumi.Aws; + * + * return await Deployment.RunAsync(() => + * { + * var example = new Aws.ApiGatewayV2.ApiMapping("example", new() + * { + * ApiId = aws_apigatewayv2_api.Example.Id, + * DomainName = aws_apigatewayv2_domain_name.Example.Id, + * Stage = aws_apigatewayv2_stage.Example.Id, + * }); + * + * }); + * ``` + * ```go + * package main + * + * import ( + * "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" + * "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + * ) + * + * func main() { + * pulumi.Run(func(ctx *pulumi.Context) error { + * _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ + * ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), + * DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), + * Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), + * }) + * if err != nil { + * return err + * } + * return nil + * }) + * } + * ``` + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.aws.apigatewayv2.ApiMapping; + * import com.pulumi.aws.apigatewayv2.ApiMappingArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var example = new ApiMapping("example", ApiMappingArgs.builder() + * .apiId(aws_apigatewayv2_api.example().id()) + * .domainName(aws_apigatewayv2_domain_name.example().id()) + * .stage(aws_apigatewayv2_stage.example().id()) + * .build()); + * + * } + * } + * ``` + * ```yaml + * resources: + * example: + * type: aws:apigatewayv2:ApiMapping + * properties: + * apiId: ${aws_apigatewayv2_api.example.id} + * domainName: ${aws_apigatewayv2_domain_name.example.id} + * stage: ${aws_apigatewayv2_stage.example.id} + * ``` + * {{% /example %}} + * {{% /examples %}} + * + * ## Import + * + * Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: + * + * ```sh + * $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com + * ``` + * + */ + export interface DomainMappingArgs { + /** + * The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). + */ + apiMappingKey?: pulumi.Input; + /** + * Identifier of an existing domain. Cannot be specified together with `DomainName`. + */ + domainId?: pulumi.Input; + /** + * Configuration of the domain name to create. Cannot be specified together with `domainId`. + */ + domainName?: inputs.apigatewayv2.DomainNameArgs; + /** + * API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. + */ + stage: pulumi.Input; + } + /** * Manages an Amazon API Gateway Version 2 domain name. * More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). @@ -349,7 +486,7 @@ export namespace apigatewayv2 { * ``` * */ - export interface DomainConfigurationArgs { + export interface DomainNameArgs { /** * Domain name configuration. See below. */ @@ -364,143 +501,6 @@ export namespace apigatewayv2 { tags?: pulumi.Input<{[key: string]: pulumi.Input}>; } - /** - * Manages an Amazon API Gateway Version 2 API mapping. - * More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). - * - * {{% examples %}} - * ## Example Usage - * {{% example %}} - * ### Basic - * - * ```typescript - * import * as pulumi from "@pulumi/pulumi"; - * import * as aws from "@pulumi/aws"; - * - * const example = new aws.apigatewayv2.ApiMapping("example", { - * apiId: aws_apigatewayv2_api.example.id, - * domainName: aws_apigatewayv2_domain_name.example.id, - * stage: aws_apigatewayv2_stage.example.id, - * }); - * ``` - * ```python - * import pulumi - * import pulumi_aws as aws - * - * example = aws.apigatewayv2.ApiMapping("example", - * api_id=aws_apigatewayv2_api["example"]["id"], - * domain_name=aws_apigatewayv2_domain_name["example"]["id"], - * stage=aws_apigatewayv2_stage["example"]["id"]) - * ``` - * ```csharp - * using System.Collections.Generic; - * using System.Linq; - * using Pulumi; - * using Aws = Pulumi.Aws; - * - * return await Deployment.RunAsync(() => - * { - * var example = new Aws.ApiGatewayV2.ApiMapping("example", new() - * { - * ApiId = aws_apigatewayv2_api.Example.Id, - * DomainName = aws_apigatewayv2_domain_name.Example.Id, - * Stage = aws_apigatewayv2_stage.Example.Id, - * }); - * - * }); - * ``` - * ```go - * package main - * - * import ( - * "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" - * "github.com/pulumi/pulumi/sdk/v3/go/pulumi" - * ) - * - * func main() { - * pulumi.Run(func(ctx *pulumi.Context) error { - * _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ - * ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), - * DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), - * Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), - * }) - * if err != nil { - * return err - * } - * return nil - * }) - * } - * ``` - * ```java - * package generated_program; - * - * import com.pulumi.Context; - * import com.pulumi.Pulumi; - * import com.pulumi.core.Output; - * import com.pulumi.aws.apigatewayv2.ApiMapping; - * import com.pulumi.aws.apigatewayv2.ApiMappingArgs; - * import java.util.List; - * import java.util.ArrayList; - * import java.util.Map; - * import java.io.File; - * import java.nio.file.Files; - * import java.nio.file.Paths; - * - * public class App { - * public static void main(String[] args) { - * Pulumi.run(App::stack); - * } - * - * public static void stack(Context ctx) { - * var example = new ApiMapping("example", ApiMappingArgs.builder() - * .apiId(aws_apigatewayv2_api.example().id()) - * .domainName(aws_apigatewayv2_domain_name.example().id()) - * .stage(aws_apigatewayv2_stage.example().id()) - * .build()); - * - * } - * } - * ``` - * ```yaml - * resources: - * example: - * type: aws:apigatewayv2:ApiMapping - * properties: - * apiId: ${aws_apigatewayv2_api.example.id} - * domainName: ${aws_apigatewayv2_domain_name.example.id} - * stage: ${aws_apigatewayv2_stage.example.id} - * ``` - * {{% /example %}} - * {{% /examples %}} - * - * ## Import - * - * Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: - * - * ```sh - * $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com - * ``` - * - */ - export interface DomainMappingArgs { - /** - * The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). - */ - apiMappingKey?: pulumi.Input; - /** - * Configuration of the domain name to create. Cannot be specified together with `domainId`. - */ - domainConfiguration?: inputs.apigatewayv2.DomainConfigurationArgs; - /** - * Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. - */ - domainId?: pulumi.Input; - /** - * API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. - */ - stage: pulumi.Input; - } - /** * Manages an Amazon API Gateway Version 2 authorizer. * More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html). diff --git a/sdk/python/pulumi_awsx/apigatewayv2/_inputs.py b/sdk/python/pulumi_awsx/apigatewayv2/_inputs.py index d13cde5f9..b026d4786 100644 --- a/sdk/python/pulumi_awsx/apigatewayv2/_inputs.py +++ b/sdk/python/pulumi_awsx/apigatewayv2/_inputs.py @@ -11,8 +11,8 @@ import pulumi_aws __all__ = [ - 'DomainConfigurationArgs', 'DomainMappingArgs', + 'DomainNameArgs', 'HttpAuthorizerArgs', 'HttpIntegrationArgs', 'HttpRouteArgs', @@ -20,7 +20,193 @@ ] @pulumi.input_type -class DomainConfigurationArgs: +class DomainMappingArgs: + def __init__(__self__, *, + stage: pulumi.Input[str], + api_mapping_key: Optional[pulumi.Input[str]] = None, + domain_id: Optional[pulumi.Input[str]] = None, + domain_name: Optional['DomainNameArgs'] = None): + """ + Manages an Amazon API Gateway Version 2 API mapping. + More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). + + {{% examples %}} + ## Example Usage + {{% example %}} + ### Basic + + ```typescript + import * as pulumi from "@pulumi/pulumi"; + import * as aws from "@pulumi/aws"; + + const example = new aws.apigatewayv2.ApiMapping("example", { + apiId: aws_apigatewayv2_api.example.id, + domainName: aws_apigatewayv2_domain_name.example.id, + stage: aws_apigatewayv2_stage.example.id, + }); + ``` + ```python + import pulumi + import pulumi_aws as aws + + example = aws.apigatewayv2.ApiMapping("example", + api_id=aws_apigatewayv2_api["example"]["id"], + domain_name=aws_apigatewayv2_domain_name["example"]["id"], + stage=aws_apigatewayv2_stage["example"]["id"]) + ``` + ```csharp + using System.Collections.Generic; + using System.Linq; + using Pulumi; + using Aws = Pulumi.Aws; + + return await Deployment.RunAsync(() => + { + var example = new Aws.ApiGatewayV2.ApiMapping("example", new() + { + ApiId = aws_apigatewayv2_api.Example.Id, + DomainName = aws_apigatewayv2_domain_name.Example.Id, + Stage = aws_apigatewayv2_stage.Example.Id, + }); + + }); + ``` + ```go + package main + + import ( + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + ) + + func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ + ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), + DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), + Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), + }) + if err != nil { + return err + } + return nil + }) + } + ``` + ```java + package generated_program; + + import com.pulumi.Context; + import com.pulumi.Pulumi; + import com.pulumi.core.Output; + import com.pulumi.aws.apigatewayv2.ApiMapping; + import com.pulumi.aws.apigatewayv2.ApiMappingArgs; + import java.util.List; + import java.util.ArrayList; + import java.util.Map; + import java.io.File; + import java.nio.file.Files; + import java.nio.file.Paths; + + public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + var example = new ApiMapping("example", ApiMappingArgs.builder() + .apiId(aws_apigatewayv2_api.example().id()) + .domainName(aws_apigatewayv2_domain_name.example().id()) + .stage(aws_apigatewayv2_stage.example().id()) + .build()); + + } + } + ``` + ```yaml + resources: + example: + type: aws:apigatewayv2:ApiMapping + properties: + apiId: ${aws_apigatewayv2_api.example.id} + domainName: ${aws_apigatewayv2_domain_name.example.id} + stage: ${aws_apigatewayv2_stage.example.id} + ``` + {{% /example %}} + {{% /examples %}} + + ## Import + + Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: + + ```sh + $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com + ``` + + :param pulumi.Input[str] stage: API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. + :param pulumi.Input[str] api_mapping_key: The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). + :param pulumi.Input[str] domain_id: Identifier of an existing domain. Cannot be specified together with `DomainName`. + :param 'DomainNameArgs' domain_name: Configuration of the domain name to create. Cannot be specified together with `domainId`. + """ + pulumi.set(__self__, "stage", stage) + if api_mapping_key is not None: + pulumi.set(__self__, "api_mapping_key", api_mapping_key) + if domain_id is not None: + pulumi.set(__self__, "domain_id", domain_id) + if domain_name is not None: + pulumi.set(__self__, "domain_name", domain_name) + + @property + @pulumi.getter + def stage(self) -> pulumi.Input[str]: + """ + API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. + """ + return pulumi.get(self, "stage") + + @stage.setter + def stage(self, value: pulumi.Input[str]): + pulumi.set(self, "stage", value) + + @property + @pulumi.getter(name="apiMappingKey") + def api_mapping_key(self) -> Optional[pulumi.Input[str]]: + """ + The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). + """ + return pulumi.get(self, "api_mapping_key") + + @api_mapping_key.setter + def api_mapping_key(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "api_mapping_key", value) + + @property + @pulumi.getter(name="domainId") + def domain_id(self) -> Optional[pulumi.Input[str]]: + """ + Identifier of an existing domain. Cannot be specified together with `DomainName`. + """ + return pulumi.get(self, "domain_id") + + @domain_id.setter + def domain_id(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "domain_id", value) + + @property + @pulumi.getter(name="domainName") + def domain_name(self) -> Optional['DomainNameArgs']: + """ + Configuration of the domain name to create. Cannot be specified together with `domainId`. + """ + return pulumi.get(self, "domain_name") + + @domain_name.setter + def domain_name(self, value: Optional['DomainNameArgs']): + pulumi.set(self, "domain_name", value) + + +@pulumi.input_type +class DomainNameArgs: def __init__(__self__, *, domain_name_configuration: pulumi.Input['pulumi_aws.apigatewayv2.DomainNameDomainNameConfigurationArgs'], mutual_tls_authentication: Optional[pulumi.Input['pulumi_aws.apigatewayv2.DomainNameMutualTlsAuthenticationArgs']] = None, @@ -410,192 +596,6 @@ def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]): pulumi.set(self, "tags", value) -@pulumi.input_type -class DomainMappingArgs: - def __init__(__self__, *, - stage: pulumi.Input[str], - api_mapping_key: Optional[pulumi.Input[str]] = None, - domain_configuration: Optional['DomainConfigurationArgs'] = None, - domain_id: Optional[pulumi.Input[str]] = None): - """ - Manages an Amazon API Gateway Version 2 API mapping. - More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). - - {{% examples %}} - ## Example Usage - {{% example %}} - ### Basic - - ```typescript - import * as pulumi from "@pulumi/pulumi"; - import * as aws from "@pulumi/aws"; - - const example = new aws.apigatewayv2.ApiMapping("example", { - apiId: aws_apigatewayv2_api.example.id, - domainName: aws_apigatewayv2_domain_name.example.id, - stage: aws_apigatewayv2_stage.example.id, - }); - ``` - ```python - import pulumi - import pulumi_aws as aws - - example = aws.apigatewayv2.ApiMapping("example", - api_id=aws_apigatewayv2_api["example"]["id"], - domain_name=aws_apigatewayv2_domain_name["example"]["id"], - stage=aws_apigatewayv2_stage["example"]["id"]) - ``` - ```csharp - using System.Collections.Generic; - using System.Linq; - using Pulumi; - using Aws = Pulumi.Aws; - - return await Deployment.RunAsync(() => - { - var example = new Aws.ApiGatewayV2.ApiMapping("example", new() - { - ApiId = aws_apigatewayv2_api.Example.Id, - DomainName = aws_apigatewayv2_domain_name.Example.Id, - Stage = aws_apigatewayv2_stage.Example.Id, - }); - - }); - ``` - ```go - package main - - import ( - "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" - ) - - func main() { - pulumi.Run(func(ctx *pulumi.Context) error { - _, err := apigatewayv2.NewApiMapping(ctx, "example", &apigatewayv2.ApiMappingArgs{ - ApiId: pulumi.Any(aws_apigatewayv2_api.Example.Id), - DomainName: pulumi.Any(aws_apigatewayv2_domain_name.Example.Id), - Stage: pulumi.Any(aws_apigatewayv2_stage.Example.Id), - }) - if err != nil { - return err - } - return nil - }) - } - ``` - ```java - package generated_program; - - import com.pulumi.Context; - import com.pulumi.Pulumi; - import com.pulumi.core.Output; - import com.pulumi.aws.apigatewayv2.ApiMapping; - import com.pulumi.aws.apigatewayv2.ApiMappingArgs; - import java.util.List; - import java.util.ArrayList; - import java.util.Map; - import java.io.File; - import java.nio.file.Files; - import java.nio.file.Paths; - - public class App { - public static void main(String[] args) { - Pulumi.run(App::stack); - } - - public static void stack(Context ctx) { - var example = new ApiMapping("example", ApiMappingArgs.builder() - .apiId(aws_apigatewayv2_api.example().id()) - .domainName(aws_apigatewayv2_domain_name.example().id()) - .stage(aws_apigatewayv2_stage.example().id()) - .build()); - - } - } - ``` - ```yaml - resources: - example: - type: aws:apigatewayv2:ApiMapping - properties: - apiId: ${aws_apigatewayv2_api.example.id} - domainName: ${aws_apigatewayv2_domain_name.example.id} - stage: ${aws_apigatewayv2_stage.example.id} - ``` - {{% /example %}} - {{% /examples %}} - - ## Import - - Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: - - ```sh - $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com - ``` - - :param pulumi.Input[str] stage: API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. - :param pulumi.Input[str] api_mapping_key: The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). - :param 'DomainConfigurationArgs' domain_configuration: Configuration of the domain name to create. Cannot be specified together with `domainId`. - :param pulumi.Input[str] domain_id: Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. - """ - pulumi.set(__self__, "stage", stage) - if api_mapping_key is not None: - pulumi.set(__self__, "api_mapping_key", api_mapping_key) - if domain_configuration is not None: - pulumi.set(__self__, "domain_configuration", domain_configuration) - if domain_id is not None: - pulumi.set(__self__, "domain_id", domain_id) - - @property - @pulumi.getter - def stage(self) -> pulumi.Input[str]: - """ - API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage. - """ - return pulumi.get(self, "stage") - - @stage.setter - def stage(self, value: pulumi.Input[str]): - pulumi.set(self, "stage", value) - - @property - @pulumi.getter(name="apiMappingKey") - def api_mapping_key(self) -> Optional[pulumi.Input[str]]: - """ - The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html). - """ - return pulumi.get(self, "api_mapping_key") - - @api_mapping_key.setter - def api_mapping_key(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "api_mapping_key", value) - - @property - @pulumi.getter(name="domainConfiguration") - def domain_configuration(self) -> Optional['DomainConfigurationArgs']: - """ - Configuration of the domain name to create. Cannot be specified together with `domainId`. - """ - return pulumi.get(self, "domain_configuration") - - @domain_configuration.setter - def domain_configuration(self, value: Optional['DomainConfigurationArgs']): - pulumi.set(self, "domain_configuration", value) - - @property - @pulumi.getter(name="domainId") - def domain_id(self) -> Optional[pulumi.Input[str]]: - """ - Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. - """ - return pulumi.get(self, "domain_id") - - @domain_id.setter - def domain_id(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "domain_id", value) - - @pulumi.input_type class HttpAuthorizerArgs: def __init__(__self__, *,