diff --git a/sdk/dotnet/Apigatewayv2/HttpApi.cs b/sdk/dotnet/Apigatewayv2/HttpApi.cs new file mode 100644 index 000000000..2f89422f2 --- /dev/null +++ b/sdk/dotnet/Apigatewayv2/HttpApi.cs @@ -0,0 +1,247 @@ +// *** WARNING: this file was generated by pulumi-gen-awsx. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Awsx.Apigatewayv2 +{ + /// + /// Creates an HTTP API with associated sub-resources. + /// + [AwsxResourceType("awsx:apigatewayv2:HttpApi")] + public partial class HttpApi : global::Pulumi.CustomResource + { + /// + /// The underlying API resource. + /// + [Output("api")] + public Output Api { get; private set; } = null!; + + /// + /// The API mappings for the HTTP API. + /// + [Output("apiMappings")] + public Output> ApiMappings { get; private set; } = null!; + + /// + /// The authorizers for the HTTP API routes. + /// + [Output("authorizers")] + public Output> Authorizers { get; private set; } = null!; + + /// + /// The deployment for the HTTP API. + /// + [Output("deployment")] + public Output Deployment { get; private set; } = null!; + + /// + /// The domain names for the HTTP API. + /// + [Output("domainNames")] + public Output> DomainNames { get; private set; } = null!; + + /// + /// The integrations for the HTTP API routes. This is a map from integration name to the integration arguments. + /// + [Output("integrations")] + public Output> Integrations { get; private set; } = null!; + + /// + /// The routes for the HTTP API. This is a map from route key (for example `GET /pets`) to route arguments. + /// + [Output("routes")] + public Output> Routes { get; private set; } = null!; + + /// + /// The deployment stages for the HTTP API. + /// + [Output("stages")] + public Output> Stages { get; private set; } = null!; + + + /// + /// Create a HttpApi resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public HttpApi(string name, HttpApiArgs args, CustomResourceOptions? options = null) + : base("awsx:apigatewayv2:HttpApi", name, args ?? new HttpApiArgs(), MakeResourceOptions(options, "")) + { + } + + private HttpApi(string name, Input id, CustomResourceOptions? options = null) + : base("awsx:apigatewayv2:HttpApi", name, null, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing HttpApi resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// A bag of options that control this resource's behavior + public static HttpApi Get(string name, Input id, CustomResourceOptions? options = null) + { + return new HttpApi(name, id, options); + } + } + + public sealed class HttpApiArgs : global::Pulumi.ResourceArgs + { + /// + /// An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + /// Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + /// Applicable for WebSocket APIs. + /// + [Input("apiKeySelectionExpression")] + public Input? ApiKeySelectionExpression { get; set; } + + [Input("authorizers")] + private InputMap? _authorizers; + + /// + /// The authorizers for the HTTP API routes. + /// + public InputMap Authorizers + { + get => _authorizers ?? (_authorizers = new InputMap()); + set => _authorizers = value; + } + + /// + /// An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + /// + [Input("body")] + public Input? Body { get; set; } + + /// + /// Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + /// + [Input("corsConfiguration")] + public Input? CorsConfiguration { get; set; } + + /// + /// Description of the API. Must be less than or equal to 1024 characters in length. + /// + [Input("description")] + public Input? Description { get; set; } + + /// + /// Whether clients can invoke the API by using the default `execute-api` endpoint. + /// By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + /// To require that clients use a custom domain name to invoke the API, disable the default endpoint. + /// + [Input("disableExecuteApiEndpoint")] + public Input? DisableExecuteApiEndpoint { get; set; } + + [Input("domainMappings")] + private InputMap? _domainMappings; + + /// + /// The domain names for the HTTP API. + /// + public InputMap DomainMappings + { + get => _domainMappings ?? (_domainMappings = new InputMap()); + set => _domainMappings = value; + } + + /// + /// Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + /// + [Input("failOnWarnings")] + public Input? FailOnWarnings { get; set; } + + [Input("integrations")] + private InputMap? _integrations; + + /// + /// The integrations for the HTTP API routes. + /// + public InputMap Integrations + { + get => _integrations ?? (_integrations = new InputMap()); + set => _integrations = value; + } + + /// + /// Name of the API. Must be less than or equal to 128 characters in length. + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + /// Defaults to `$request.method $request.path`. + /// + [Input("routeSelectionExpression")] + public Input? RouteSelectionExpression { get; set; } + + [Input("routes", required: true)] + private InputMap? _routes; + + /// + /// The routes for the HTTP API. + /// + public InputMap Routes + { + get => _routes ?? (_routes = new InputMap()); + set => _routes = value; + } + + [Input("stages")] + private InputMap? _stages; + + /// + /// The deployment stages for the HTTP API. + /// + public InputMap Stages + { + get => _stages ?? (_stages = new InputMap()); + set => _stages = value; + } + + [Input("tags")] + private InputMap? _tags; + + /// + /// Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + /// + public InputMap Tags + { + get => _tags ?? (_tags = new InputMap()); + set => _tags = value; + } + + /// + /// Version identifier for the API. Must be between 1 and 64 characters in length. + /// + [Input("version")] + public Input? Version { get; set; } + + public HttpApiArgs() + { + } + public static new HttpApiArgs Empty => new HttpApiArgs(); + } +} diff --git a/sdk/dotnet/Apigatewayv2/Inputs/DomainConfigurationArgs.cs b/sdk/dotnet/Apigatewayv2/Inputs/DomainConfigurationArgs.cs new file mode 100644 index 000000000..1a24151a4 --- /dev/null +++ b/sdk/dotnet/Apigatewayv2/Inputs/DomainConfigurationArgs.cs @@ -0,0 +1,383 @@ +// *** WARNING: this file was generated by pulumi-gen-awsx. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Awsx.Apigatewayv2.Inputs +{ + + /// + /// 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). + /// + /// > **Note:** This resource establishes ownership of and the TLS settings for + /// a particular domain name. An API stage can be associated with the domain name using the `aws.apigatewayv2.ApiMapping` resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// ### Basic + /// + /// ```typescript + /// import * as pulumi from "@pulumi/pulumi"; + /// import * as aws from "@pulumi/aws"; + /// + /// const example = new aws.apigatewayv2.DomainName("example", { + /// domainName: "ws-api.example.com", + /// domainNameConfiguration: { + /// certificateArn: aws_acm_certificate.example.arn, + /// endpointType: "REGIONAL", + /// securityPolicy: "TLS_1_2", + /// }, + /// }); + /// ``` + /// ```python + /// import pulumi + /// import pulumi_aws as aws + /// + /// example = aws.apigatewayv2.DomainName("example", + /// domain_name="ws-api.example.com", + /// domain_name_configuration=aws.apigatewayv2.DomainNameDomainNameConfigurationArgs( + /// certificate_arn=aws_acm_certificate["example"]["arn"], + /// endpoint_type="REGIONAL", + /// security_policy="TLS_1_2", + /// )) + /// ``` + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Aws = Pulumi.Aws; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Aws.ApiGatewayV2.DomainName("example", new() + /// { + /// Domain = "ws-api.example.com", + /// DomainNameConfiguration = new Aws.ApiGatewayV2.Inputs.DomainNameDomainNameConfigurationArgs + /// { + /// CertificateArn = aws_acm_certificate.Example.Arn, + /// EndpointType = "REGIONAL", + /// SecurityPolicy = "TLS_1_2", + /// }, + /// }); + /// + /// }); + /// ``` + /// ```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.NewDomainName(ctx, "example", &apigatewayv2.DomainNameArgs{ + /// DomainName: pulumi.String("ws-api.example.com"), + /// DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ + /// CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), + /// EndpointType: pulumi.String("REGIONAL"), + /// SecurityPolicy: pulumi.String("TLS_1_2"), + /// }, + /// }) + /// 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.DomainName; + /// import com.pulumi.aws.apigatewayv2.DomainNameArgs; + /// import com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs; + /// 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 DomainName("example", DomainNameArgs.builder() + /// .domainName("ws-api.example.com") + /// .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder() + /// .certificateArn(aws_acm_certificate.example().arn()) + /// .endpointType("REGIONAL") + /// .securityPolicy("TLS_1_2") + /// .build()) + /// .build()); + /// + /// } + /// } + /// ``` + /// ```yaml + /// resources: + /// example: + /// type: aws:apigatewayv2:DomainName + /// properties: + /// domainName: ws-api.example.com + /// domainNameConfiguration: + /// certificateArn: ${aws_acm_certificate.example.arn} + /// endpointType: REGIONAL + /// securityPolicy: TLS_1_2 + /// ``` + /// {{% /example %}} + /// {{% example %}} + /// ### Associated Route 53 Resource Record + /// + /// ```typescript + /// import * as pulumi from "@pulumi/pulumi"; + /// import * as aws from "@pulumi/aws"; + /// + /// const exampleDomainName = new aws.apigatewayv2.DomainName("exampleDomainName", { + /// domainName: "http-api.example.com", + /// domainNameConfiguration: { + /// certificateArn: aws_acm_certificate.example.arn, + /// endpointType: "REGIONAL", + /// securityPolicy: "TLS_1_2", + /// }, + /// }); + /// const exampleRecord = new aws.route53.Record("exampleRecord", { + /// name: exampleDomainName.domainName, + /// type: "A", + /// zoneId: aws_route53_zone.example.zone_id, + /// aliases: [{ + /// name: exampleDomainName.domainNameConfiguration.apply(domainNameConfiguration => domainNameConfiguration.targetDomainName), + /// zoneId: exampleDomainName.domainNameConfiguration.apply(domainNameConfiguration => domainNameConfiguration.hostedZoneId), + /// evaluateTargetHealth: false, + /// }], + /// }); + /// ``` + /// ```python + /// import pulumi + /// import pulumi_aws as aws + /// + /// example_domain_name = aws.apigatewayv2.DomainName("exampleDomainName", + /// domain_name="http-api.example.com", + /// domain_name_configuration=aws.apigatewayv2.DomainNameDomainNameConfigurationArgs( + /// certificate_arn=aws_acm_certificate["example"]["arn"], + /// endpoint_type="REGIONAL", + /// security_policy="TLS_1_2", + /// )) + /// example_record = aws.route53.Record("exampleRecord", + /// name=example_domain_name.domain_name, + /// type="A", + /// zone_id=aws_route53_zone["example"]["zone_id"], + /// aliases=[aws.route53.RecordAliasArgs( + /// name=example_domain_name.domain_name_configuration.target_domain_name, + /// zone_id=example_domain_name.domain_name_configuration.hosted_zone_id, + /// evaluate_target_health=False, + /// )]) + /// ``` + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Aws = Pulumi.Aws; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleDomainName = new Aws.ApiGatewayV2.DomainName("exampleDomainName", new() + /// { + /// Domain = "http-api.example.com", + /// DomainNameConfiguration = new Aws.ApiGatewayV2.Inputs.DomainNameDomainNameConfigurationArgs + /// { + /// CertificateArn = aws_acm_certificate.Example.Arn, + /// EndpointType = "REGIONAL", + /// SecurityPolicy = "TLS_1_2", + /// }, + /// }); + /// + /// var exampleRecord = new Aws.Route53.Record("exampleRecord", new() + /// { + /// Name = exampleDomainName.Domain, + /// Type = "A", + /// ZoneId = aws_route53_zone.Example.Zone_id, + /// Aliases = new[] + /// { + /// new Aws.Route53.Inputs.RecordAliasArgs + /// { + /// Name = exampleDomainName.DomainNameConfiguration.Apply(domainNameConfiguration => domainNameConfiguration.TargetDomainName), + /// ZoneId = exampleDomainName.DomainNameConfiguration.Apply(domainNameConfiguration => domainNameConfiguration.HostedZoneId), + /// EvaluateTargetHealth = false, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ```go + /// package main + /// + /// import ( + /// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" + /// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53" + /// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + /// ) + /// + /// func main() { + /// pulumi.Run(func(ctx *pulumi.Context) error { + /// exampleDomainName, err := apigatewayv2.NewDomainName(ctx, "exampleDomainName", &apigatewayv2.DomainNameArgs{ + /// DomainName: pulumi.String("http-api.example.com"), + /// DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ + /// CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), + /// EndpointType: pulumi.String("REGIONAL"), + /// SecurityPolicy: pulumi.String("TLS_1_2"), + /// }, + /// }) + /// if err != nil { + /// return err + /// } + /// _, err = route53.NewRecord(ctx, "exampleRecord", &route53.RecordArgs{ + /// Name: exampleDomainName.DomainName, + /// Type: pulumi.String("A"), + /// ZoneId: pulumi.Any(aws_route53_zone.Example.Zone_id), + /// Aliases: route53.RecordAliasArray{ + /// &route53.RecordAliasArgs{ + /// Name: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { + /// return &domainNameConfiguration.TargetDomainName, nil + /// }).(pulumi.StringPtrOutput), + /// ZoneId: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { + /// return &domainNameConfiguration.HostedZoneId, nil + /// }).(pulumi.StringPtrOutput), + /// EvaluateTargetHealth: pulumi.Bool(false), + /// }, + /// }, + /// }) + /// 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.DomainName; + /// import com.pulumi.aws.apigatewayv2.DomainNameArgs; + /// import com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs; + /// import com.pulumi.aws.route53.Record; + /// import com.pulumi.aws.route53.RecordArgs; + /// import com.pulumi.aws.route53.inputs.RecordAliasArgs; + /// 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 exampleDomainName = new DomainName("exampleDomainName", DomainNameArgs.builder() + /// .domainName("http-api.example.com") + /// .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder() + /// .certificateArn(aws_acm_certificate.example().arn()) + /// .endpointType("REGIONAL") + /// .securityPolicy("TLS_1_2") + /// .build()) + /// .build()); + /// + /// var exampleRecord = new Record("exampleRecord", RecordArgs.builder() + /// .name(exampleDomainName.domainName()) + /// .type("A") + /// .zoneId(aws_route53_zone.example().zone_id()) + /// .aliases(RecordAliasArgs.builder() + /// .name(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -> domainNameConfiguration.targetDomainName())) + /// .zoneId(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -> domainNameConfiguration.hostedZoneId())) + /// .evaluateTargetHealth(false) + /// .build()) + /// .build()); + /// + /// } + /// } + /// ``` + /// ```yaml + /// resources: + /// exampleDomainName: + /// type: aws:apigatewayv2:DomainName + /// properties: + /// domainName: http-api.example.com + /// domainNameConfiguration: + /// certificateArn: ${aws_acm_certificate.example.arn} + /// endpointType: REGIONAL + /// securityPolicy: TLS_1_2 + /// exampleRecord: + /// type: aws:route53:Record + /// properties: + /// name: ${exampleDomainName.domainName} + /// type: A + /// zoneId: ${aws_route53_zone.example.zone_id} + /// aliases: + /// - name: ${exampleDomainName.domainNameConfiguration.targetDomainName} + /// zoneId: ${exampleDomainName.domainNameConfiguration.hostedZoneId} + /// evaluateTargetHealth: false + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + /// ## Import + /// + /// Using `pulumi import`, import `aws_apigatewayv2_domain_name` using the domain name. For example: + /// + /// ```sh + /// $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com + /// ``` + /// + /// + public sealed class DomainConfigurationArgs : global::Pulumi.ResourceArgs + { + /// + /// Domain name configuration. See below. + /// + [Input("domainNameConfiguration")] + public Input? DomainNameConfiguration { get; set; } + + /// + /// Mutual TLS authentication configuration for the domain name. + /// + [Input("mutualTlsAuthentication")] + public Input? MutualTlsAuthentication { get; set; } + + [Input("tags")] + private InputMap? _tags; + + /// + /// 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. + /// + public InputMap Tags + { + get => _tags ?? (_tags = new InputMap()); + set => _tags = value; + } + + public DomainConfigurationArgs() + { + } + public static new DomainConfigurationArgs Empty => new DomainConfigurationArgs(); + } +} diff --git a/sdk/dotnet/Apigatewayv2/Inputs/DomainMappingArgs.cs b/sdk/dotnet/Apigatewayv2/Inputs/DomainMappingArgs.cs new file mode 100644 index 000000000..5bea78cd1 --- /dev/null +++ b/sdk/dotnet/Apigatewayv2/Inputs/DomainMappingArgs.cs @@ -0,0 +1,32 @@ +// *** WARNING: this file was generated by pulumi-gen-awsx. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Awsx.Apigatewayv2.Inputs +{ + + public sealed class DomainMappingArgs : global::Pulumi.ResourceArgs + { + /// + /// Configuration of the domain name to create. Cannot be specified together with `domainId`. + /// + [Input("domainConfiguration")] + public Input? DomainConfiguration { get; set; } + + /// + /// Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + /// + [Input("domainId")] + public Input? DomainId { get; set; } + + public DomainMappingArgs() + { + } + public static new DomainMappingArgs Empty => new DomainMappingArgs(); + } +} diff --git a/sdk/dotnet/Apigatewayv2/Inputs/HttpAuthorizerArgs.cs b/sdk/dotnet/Apigatewayv2/Inputs/HttpAuthorizerArgs.cs new file mode 100644 index 000000000..4321e4eff --- /dev/null +++ b/sdk/dotnet/Apigatewayv2/Inputs/HttpAuthorizerArgs.cs @@ -0,0 +1,20 @@ +// *** WARNING: this file was generated by pulumi-gen-awsx. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Awsx.Apigatewayv2.Inputs +{ + + public sealed class HttpAuthorizerArgs : global::Pulumi.ResourceArgs + { + public HttpAuthorizerArgs() + { + } + public static new HttpAuthorizerArgs Empty => new HttpAuthorizerArgs(); + } +} diff --git a/sdk/dotnet/Apigatewayv2/Inputs/HttpIntegrationArgs.cs b/sdk/dotnet/Apigatewayv2/Inputs/HttpIntegrationArgs.cs new file mode 100644 index 000000000..6d380100a --- /dev/null +++ b/sdk/dotnet/Apigatewayv2/Inputs/HttpIntegrationArgs.cs @@ -0,0 +1,20 @@ +// *** WARNING: this file was generated by pulumi-gen-awsx. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Awsx.Apigatewayv2.Inputs +{ + + public sealed class HttpIntegrationArgs : global::Pulumi.ResourceArgs + { + public HttpIntegrationArgs() + { + } + public static new HttpIntegrationArgs Empty => new HttpIntegrationArgs(); + } +} diff --git a/sdk/dotnet/Apigatewayv2/Inputs/HttpRouteArgs.cs b/sdk/dotnet/Apigatewayv2/Inputs/HttpRouteArgs.cs new file mode 100644 index 000000000..ccb2387fd --- /dev/null +++ b/sdk/dotnet/Apigatewayv2/Inputs/HttpRouteArgs.cs @@ -0,0 +1,32 @@ +// *** WARNING: this file was generated by pulumi-gen-awsx. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Awsx.Apigatewayv2.Inputs +{ + + public sealed class HttpRouteArgs : global::Pulumi.ResourceArgs + { + /// + /// The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + /// + [Input("authorizer")] + public Input? Authorizer { get; set; } + + /// + /// The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + /// + [Input("integration")] + public Input? Integration { get; set; } + + public HttpRouteArgs() + { + } + public static new HttpRouteArgs Empty => new HttpRouteArgs(); + } +} diff --git a/sdk/dotnet/Apigatewayv2/Inputs/HttpStageArgs.cs b/sdk/dotnet/Apigatewayv2/Inputs/HttpStageArgs.cs new file mode 100644 index 000000000..06bdee75a --- /dev/null +++ b/sdk/dotnet/Apigatewayv2/Inputs/HttpStageArgs.cs @@ -0,0 +1,20 @@ +// *** WARNING: this file was generated by pulumi-gen-awsx. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Awsx.Apigatewayv2.Inputs +{ + + public sealed class HttpStageArgs : global::Pulumi.ResourceArgs + { + public HttpStageArgs() + { + } + public static new HttpStageArgs Empty => new HttpStageArgs(); + } +} diff --git a/sdk/dotnet/Apigatewayv2/README.md b/sdk/dotnet/Apigatewayv2/README.md new file mode 100644 index 000000000..f5452bf23 --- /dev/null +++ b/sdk/dotnet/Apigatewayv2/README.md @@ -0,0 +1 @@ +Pulumi Amazon Web Services (AWS) AWSX Components. diff --git a/sdk/go/awsx/apigatewayv2/httpApi.go b/sdk/go/awsx/apigatewayv2/httpApi.go new file mode 100644 index 000000000..3dd7118ef --- /dev/null +++ b/sdk/go/awsx/apigatewayv2/httpApi.go @@ -0,0 +1,368 @@ +// Code generated by pulumi-gen-awsx DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package apigatewayv2 + +import ( + "context" + "reflect" + + "errors" + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" + "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" +) + +// Creates an HTTP API with associated sub-resources. +type HttpApi struct { + pulumi.CustomResourceState + + // The underlying API resource. + Api apigatewayv2.ApiOutput `pulumi:"api"` + // The API mappings for the HTTP API. + ApiMappings apigatewayv2.ApiMappingArrayOutput `pulumi:"apiMappings"` + // The authorizers for the HTTP API routes. + Authorizers apigatewayv2.AuthorizerArrayOutput `pulumi:"authorizers"` + // The deployment for the HTTP API. + Deployment apigatewayv2.DeploymentOutput `pulumi:"deployment"` + // The domain names for the HTTP API. + DomainNames apigatewayv2.DomainNameArrayOutput `pulumi:"domainNames"` + // The integrations for the HTTP API routes. This is a map from integration name to the integration arguments. + Integrations apigatewayv2.IntegrationArrayOutput `pulumi:"integrations"` + // The routes for the HTTP API. This is a map from route key (for example `GET /pets`) to route arguments. + Routes apigatewayv2.RouteArrayOutput `pulumi:"routes"` + // The deployment stages for the HTTP API. + Stages apigatewayv2.StageArrayOutput `pulumi:"stages"` +} + +// NewHttpApi registers a new resource with the given unique name, arguments, and options. +func NewHttpApi(ctx *pulumi.Context, + name string, args *HttpApiArgs, opts ...pulumi.ResourceOption) (*HttpApi, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.Routes == nil { + return nil, errors.New("invalid value for required argument 'Routes'") + } + opts = internal.PkgResourceDefaultOpts(opts) + var resource HttpApi + err := ctx.RegisterResource("awsx:apigatewayv2:HttpApi", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetHttpApi gets an existing HttpApi resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetHttpApi(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *HttpApiState, opts ...pulumi.ResourceOption) (*HttpApi, error) { + var resource HttpApi + err := ctx.ReadResource("awsx:apigatewayv2:HttpApi", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering HttpApi resources. +type httpApiState struct { +} + +type HttpApiState struct { +} + +func (HttpApiState) ElementType() reflect.Type { + return reflect.TypeOf((*httpApiState)(nil)).Elem() +} + +type httpApiArgs struct { + // An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + // Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + // Applicable for WebSocket APIs. + ApiKeySelectionExpression *string `pulumi:"apiKeySelectionExpression"` + // The authorizers for the HTTP API routes. + Authorizers map[string]HttpAuthorizer `pulumi:"authorizers"` + // An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + Body *string `pulumi:"body"` + // Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + CorsConfiguration *apigatewayv2.ApiCorsConfiguration `pulumi:"corsConfiguration"` + // Description of the API. Must be less than or equal to 1024 characters in length. + Description *string `pulumi:"description"` + // Whether clients can invoke the API by using the default `execute-api` endpoint. + // By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + // To require that clients use a custom domain name to invoke the API, disable the default endpoint. + DisableExecuteApiEndpoint *bool `pulumi:"disableExecuteApiEndpoint"` + // The domain names for the HTTP API. + DomainMappings map[string]DomainMapping `pulumi:"domainMappings"` + // Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + FailOnWarnings *bool `pulumi:"failOnWarnings"` + // The integrations for the HTTP API routes. + Integrations map[string]HttpIntegration `pulumi:"integrations"` + // Name of the API. Must be less than or equal to 128 characters in length. + Name *string `pulumi:"name"` + // The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + // Defaults to `$request.method $request.path`. + RouteSelectionExpression *string `pulumi:"routeSelectionExpression"` + // The routes for the HTTP API. + Routes map[string]HttpRoute `pulumi:"routes"` + // The deployment stages for the HTTP API. + Stages map[string]HttpStage `pulumi:"stages"` + // Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + Tags map[string]string `pulumi:"tags"` + // Version identifier for the API. Must be between 1 and 64 characters in length. + Version *string `pulumi:"version"` +} + +// The set of arguments for constructing a HttpApi resource. +type HttpApiArgs struct { + // An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + // Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + // Applicable for WebSocket APIs. + ApiKeySelectionExpression pulumi.StringPtrInput + // The authorizers for the HTTP API routes. + Authorizers HttpAuthorizerMapInput + // An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + Body pulumi.StringPtrInput + // Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + CorsConfiguration apigatewayv2.ApiCorsConfigurationPtrInput + // Description of the API. Must be less than or equal to 1024 characters in length. + Description pulumi.StringPtrInput + // Whether clients can invoke the API by using the default `execute-api` endpoint. + // By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + // To require that clients use a custom domain name to invoke the API, disable the default endpoint. + DisableExecuteApiEndpoint pulumi.BoolPtrInput + // The domain names for the HTTP API. + DomainMappings DomainMappingMapInput + // Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + FailOnWarnings pulumi.BoolPtrInput + // The integrations for the HTTP API routes. + Integrations HttpIntegrationMapInput + // Name of the API. Must be less than or equal to 128 characters in length. + Name pulumi.StringPtrInput + // The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + // Defaults to `$request.method $request.path`. + RouteSelectionExpression pulumi.StringPtrInput + // The routes for the HTTP API. + Routes HttpRouteMapInput + // The deployment stages for the HTTP API. + Stages HttpStageMapInput + // Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + Tags pulumi.StringMapInput + // Version identifier for the API. Must be between 1 and 64 characters in length. + Version pulumi.StringPtrInput +} + +func (HttpApiArgs) ElementType() reflect.Type { + return reflect.TypeOf((*httpApiArgs)(nil)).Elem() +} + +type HttpApiInput interface { + pulumi.Input + + ToHttpApiOutput() HttpApiOutput + ToHttpApiOutputWithContext(ctx context.Context) HttpApiOutput +} + +func (*HttpApi) ElementType() reflect.Type { + return reflect.TypeOf((**HttpApi)(nil)).Elem() +} + +func (i *HttpApi) ToHttpApiOutput() HttpApiOutput { + return i.ToHttpApiOutputWithContext(context.Background()) +} + +func (i *HttpApi) ToHttpApiOutputWithContext(ctx context.Context) HttpApiOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpApiOutput) +} + +func (i *HttpApi) ToOutput(ctx context.Context) pulumix.Output[*HttpApi] { + return pulumix.Output[*HttpApi]{ + OutputState: i.ToHttpApiOutputWithContext(ctx).OutputState, + } +} + +// HttpApiArrayInput is an input type that accepts HttpApiArray and HttpApiArrayOutput values. +// You can construct a concrete instance of `HttpApiArrayInput` via: +// +// HttpApiArray{ HttpApiArgs{...} } +type HttpApiArrayInput interface { + pulumi.Input + + ToHttpApiArrayOutput() HttpApiArrayOutput + ToHttpApiArrayOutputWithContext(context.Context) HttpApiArrayOutput +} + +type HttpApiArray []HttpApiInput + +func (HttpApiArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]*HttpApi)(nil)).Elem() +} + +func (i HttpApiArray) ToHttpApiArrayOutput() HttpApiArrayOutput { + return i.ToHttpApiArrayOutputWithContext(context.Background()) +} + +func (i HttpApiArray) ToHttpApiArrayOutputWithContext(ctx context.Context) HttpApiArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpApiArrayOutput) +} + +func (i HttpApiArray) ToOutput(ctx context.Context) pulumix.Output[[]*HttpApi] { + return pulumix.Output[[]*HttpApi]{ + OutputState: i.ToHttpApiArrayOutputWithContext(ctx).OutputState, + } +} + +// HttpApiMapInput is an input type that accepts HttpApiMap and HttpApiMapOutput values. +// You can construct a concrete instance of `HttpApiMapInput` via: +// +// HttpApiMap{ "key": HttpApiArgs{...} } +type HttpApiMapInput interface { + pulumi.Input + + ToHttpApiMapOutput() HttpApiMapOutput + ToHttpApiMapOutputWithContext(context.Context) HttpApiMapOutput +} + +type HttpApiMap map[string]HttpApiInput + +func (HttpApiMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*HttpApi)(nil)).Elem() +} + +func (i HttpApiMap) ToHttpApiMapOutput() HttpApiMapOutput { + return i.ToHttpApiMapOutputWithContext(context.Background()) +} + +func (i HttpApiMap) ToHttpApiMapOutputWithContext(ctx context.Context) HttpApiMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpApiMapOutput) +} + +func (i HttpApiMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*HttpApi] { + return pulumix.Output[map[string]*HttpApi]{ + OutputState: i.ToHttpApiMapOutputWithContext(ctx).OutputState, + } +} + +type HttpApiOutput struct{ *pulumi.OutputState } + +func (HttpApiOutput) ElementType() reflect.Type { + return reflect.TypeOf((**HttpApi)(nil)).Elem() +} + +func (o HttpApiOutput) ToHttpApiOutput() HttpApiOutput { + return o +} + +func (o HttpApiOutput) ToHttpApiOutputWithContext(ctx context.Context) HttpApiOutput { + return o +} + +func (o HttpApiOutput) ToOutput(ctx context.Context) pulumix.Output[*HttpApi] { + return pulumix.Output[*HttpApi]{ + OutputState: o.OutputState, + } +} + +// The underlying API resource. +func (o HttpApiOutput) Api() apigatewayv2.ApiOutput { + return o.ApplyT(func(v *HttpApi) apigatewayv2.ApiOutput { return v.Api }).(apigatewayv2.ApiOutput) +} + +// The API mappings for the HTTP API. +func (o HttpApiOutput) ApiMappings() apigatewayv2.ApiMappingArrayOutput { + return o.ApplyT(func(v *HttpApi) apigatewayv2.ApiMappingArrayOutput { return v.ApiMappings }).(apigatewayv2.ApiMappingArrayOutput) +} + +// The authorizers for the HTTP API routes. +func (o HttpApiOutput) Authorizers() apigatewayv2.AuthorizerArrayOutput { + return o.ApplyT(func(v *HttpApi) apigatewayv2.AuthorizerArrayOutput { return v.Authorizers }).(apigatewayv2.AuthorizerArrayOutput) +} + +// The deployment for the HTTP API. +func (o HttpApiOutput) Deployment() apigatewayv2.DeploymentOutput { + return o.ApplyT(func(v *HttpApi) apigatewayv2.DeploymentOutput { return v.Deployment }).(apigatewayv2.DeploymentOutput) +} + +// The domain names for the HTTP API. +func (o HttpApiOutput) DomainNames() apigatewayv2.DomainNameArrayOutput { + return o.ApplyT(func(v *HttpApi) apigatewayv2.DomainNameArrayOutput { return v.DomainNames }).(apigatewayv2.DomainNameArrayOutput) +} + +// The integrations for the HTTP API routes. This is a map from integration name to the integration arguments. +func (o HttpApiOutput) Integrations() apigatewayv2.IntegrationArrayOutput { + return o.ApplyT(func(v *HttpApi) apigatewayv2.IntegrationArrayOutput { return v.Integrations }).(apigatewayv2.IntegrationArrayOutput) +} + +// The routes for the HTTP API. This is a map from route key (for example `GET /pets`) to route arguments. +func (o HttpApiOutput) Routes() apigatewayv2.RouteArrayOutput { + return o.ApplyT(func(v *HttpApi) apigatewayv2.RouteArrayOutput { return v.Routes }).(apigatewayv2.RouteArrayOutput) +} + +// The deployment stages for the HTTP API. +func (o HttpApiOutput) Stages() apigatewayv2.StageArrayOutput { + return o.ApplyT(func(v *HttpApi) apigatewayv2.StageArrayOutput { return v.Stages }).(apigatewayv2.StageArrayOutput) +} + +type HttpApiArrayOutput struct{ *pulumi.OutputState } + +func (HttpApiArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]*HttpApi)(nil)).Elem() +} + +func (o HttpApiArrayOutput) ToHttpApiArrayOutput() HttpApiArrayOutput { + return o +} + +func (o HttpApiArrayOutput) ToHttpApiArrayOutputWithContext(ctx context.Context) HttpApiArrayOutput { + return o +} + +func (o HttpApiArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*HttpApi] { + return pulumix.Output[[]*HttpApi]{ + OutputState: o.OutputState, + } +} + +func (o HttpApiArrayOutput) Index(i pulumi.IntInput) HttpApiOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HttpApi { + return vs[0].([]*HttpApi)[vs[1].(int)] + }).(HttpApiOutput) +} + +type HttpApiMapOutput struct{ *pulumi.OutputState } + +func (HttpApiMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*HttpApi)(nil)).Elem() +} + +func (o HttpApiMapOutput) ToHttpApiMapOutput() HttpApiMapOutput { + return o +} + +func (o HttpApiMapOutput) ToHttpApiMapOutputWithContext(ctx context.Context) HttpApiMapOutput { + return o +} + +func (o HttpApiMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*HttpApi] { + return pulumix.Output[map[string]*HttpApi]{ + OutputState: o.OutputState, + } +} + +func (o HttpApiMapOutput) MapIndex(k pulumi.StringInput) HttpApiOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HttpApi { + return vs[0].(map[string]*HttpApi)[vs[1].(string)] + }).(HttpApiOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*HttpApiInput)(nil)).Elem(), &HttpApi{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpApiArrayInput)(nil)).Elem(), HttpApiArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpApiMapInput)(nil)).Elem(), HttpApiMap{}) + pulumi.RegisterOutputType(HttpApiOutput{}) + pulumi.RegisterOutputType(HttpApiArrayOutput{}) + pulumi.RegisterOutputType(HttpApiMapOutput{}) +} diff --git a/sdk/go/awsx/apigatewayv2/init.go b/sdk/go/awsx/apigatewayv2/init.go new file mode 100644 index 000000000..15821c33d --- /dev/null +++ b/sdk/go/awsx/apigatewayv2/init.go @@ -0,0 +1,45 @@ +// Code generated by pulumi-gen-awsx DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package apigatewayv2 + +import ( + "fmt" + + "github.com/blang/semver" + "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/internal" + _ "github.com/pulumi/pulumi-docker/sdk/v4/go/docker" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +type module struct { + version semver.Version +} + +func (m *module) Version() semver.Version { + return m.version +} + +func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { + switch typ { + case "awsx:apigatewayv2:HttpApi": + r = &HttpApi{} + default: + return nil, fmt.Errorf("unknown resource type: %s", typ) + } + + err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) + return +} + +func init() { + version, err := internal.PkgVersion() + if err != nil { + version = semver.Version{Major: 1} + } + pulumi.RegisterResourceModule( + "awsx", + "apigatewayv2", + &module{version}, + ) +} diff --git a/sdk/go/awsx/apigatewayv2/pulumiTypes.go b/sdk/go/awsx/apigatewayv2/pulumiTypes.go new file mode 100644 index 000000000..835910dad --- /dev/null +++ b/sdk/go/awsx/apigatewayv2/pulumiTypes.go @@ -0,0 +1,1127 @@ +// Code generated by pulumi-gen-awsx DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package apigatewayv2 + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" + "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" +) + +var _ = internal.GetEnvOrDefault + +// 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). +// +// > **Note:** This resource establishes ownership of and the TLS settings for +// a particular domain name. An API stage can be associated with the domain name using the `aws.apigatewayv2.ApiMapping` resource. +// +// ## 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.NewDomainName(ctx, "example", &apigatewayv2.DomainNameArgs{ +// DomainName: pulumi.String("ws-api.example.com"), +// DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ +// CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), +// EndpointType: pulumi.String("REGIONAL"), +// SecurityPolicy: pulumi.String("TLS_1_2"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Associated Route 53 Resource Record +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleDomainName, err := apigatewayv2.NewDomainName(ctx, "exampleDomainName", &apigatewayv2.DomainNameArgs{ +// DomainName: pulumi.String("http-api.example.com"), +// DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ +// CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), +// EndpointType: pulumi.String("REGIONAL"), +// SecurityPolicy: pulumi.String("TLS_1_2"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = route53.NewRecord(ctx, "exampleRecord", &route53.RecordArgs{ +// Name: exampleDomainName.DomainName, +// Type: pulumi.String("A"), +// ZoneId: pulumi.Any(aws_route53_zone.Example.Zone_id), +// Aliases: route53.RecordAliasArray{ +// &route53.RecordAliasArgs{ +// Name: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { +// return &domainNameConfiguration.TargetDomainName, nil +// }).(pulumi.StringPtrOutput), +// ZoneId: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { +// return &domainNameConfiguration.HostedZoneId, nil +// }).(pulumi.StringPtrOutput), +// EvaluateTargetHealth: pulumi.Bool(false), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// Using `pulumi import`, import `aws_apigatewayv2_domain_name` using the domain name. For example: +// +// ```sh +// +// $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com +// +// ``` +type DomainConfiguration struct { + // Domain name configuration. See below. + DomainNameConfiguration *apigatewayv2.DomainNameDomainNameConfiguration `pulumi:"domainNameConfiguration"` + // Mutual TLS authentication configuration for the domain name. + MutualTlsAuthentication *apigatewayv2.DomainNameMutualTlsAuthentication `pulumi:"mutualTlsAuthentication"` + // 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. + 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: +// +// DomainConfigurationArgs{...} +type DomainConfigurationInput interface { + pulumi.Input + + ToDomainConfigurationOutput() DomainConfigurationOutput + ToDomainConfigurationOutputWithContext(context.Context) DomainConfigurationOutput +} + +// 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). +// +// > **Note:** This resource establishes ownership of and the TLS settings for +// a particular domain name. An API stage can be associated with the domain name using the `aws.apigatewayv2.ApiMapping` resource. +// +// ## 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.NewDomainName(ctx, "example", &apigatewayv2.DomainNameArgs{ +// DomainName: pulumi.String("ws-api.example.com"), +// DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ +// CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), +// EndpointType: pulumi.String("REGIONAL"), +// SecurityPolicy: pulumi.String("TLS_1_2"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Associated Route 53 Resource Record +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleDomainName, err := apigatewayv2.NewDomainName(ctx, "exampleDomainName", &apigatewayv2.DomainNameArgs{ +// DomainName: pulumi.String("http-api.example.com"), +// DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ +// CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), +// EndpointType: pulumi.String("REGIONAL"), +// SecurityPolicy: pulumi.String("TLS_1_2"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = route53.NewRecord(ctx, "exampleRecord", &route53.RecordArgs{ +// Name: exampleDomainName.DomainName, +// Type: pulumi.String("A"), +// ZoneId: pulumi.Any(aws_route53_zone.Example.Zone_id), +// Aliases: route53.RecordAliasArray{ +// &route53.RecordAliasArgs{ +// Name: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { +// return &domainNameConfiguration.TargetDomainName, nil +// }).(pulumi.StringPtrOutput), +// ZoneId: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { +// return &domainNameConfiguration.HostedZoneId, nil +// }).(pulumi.StringPtrOutput), +// EvaluateTargetHealth: pulumi.Bool(false), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// Using `pulumi import`, import `aws_apigatewayv2_domain_name` using the domain name. For example: +// +// ```sh +// +// $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com +// +// ``` +type DomainConfigurationArgs struct { + // Domain name configuration. See below. + DomainNameConfiguration apigatewayv2.DomainNameDomainNameConfigurationPtrInput `pulumi:"domainNameConfiguration"` + // Mutual TLS authentication configuration for the domain name. + MutualTlsAuthentication apigatewayv2.DomainNameMutualTlsAuthenticationPtrInput `pulumi:"mutualTlsAuthentication"` + // 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. + Tags pulumi.StringMapInput `pulumi:"tags"` +} + +func (DomainConfigurationArgs) ElementType() reflect.Type { + return reflect.TypeOf((*DomainConfiguration)(nil)).Elem() +} + +func (i DomainConfigurationArgs) ToDomainConfigurationOutput() DomainConfigurationOutput { + return i.ToDomainConfigurationOutputWithContext(context.Background()) +} + +func (i DomainConfigurationArgs) ToDomainConfigurationOutputWithContext(ctx context.Context) DomainConfigurationOutput { + return pulumi.ToOutputWithContext(ctx, i).(DomainConfigurationOutput) +} + +func (i DomainConfigurationArgs) ToOutput(ctx context.Context) pulumix.Output[DomainConfiguration] { + return pulumix.Output[DomainConfiguration]{ + OutputState: i.ToDomainConfigurationOutputWithContext(ctx).OutputState, + } +} + +func (i DomainConfigurationArgs) ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput { + return i.ToDomainConfigurationPtrOutputWithContext(context.Background()) +} + +func (i DomainConfigurationArgs) ToDomainConfigurationPtrOutputWithContext(ctx context.Context) DomainConfigurationPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(DomainConfigurationOutput).ToDomainConfigurationPtrOutputWithContext(ctx) +} + +// DomainConfigurationPtrInput is an input type that accepts DomainConfigurationArgs, DomainConfigurationPtr and DomainConfigurationPtrOutput values. +// You can construct a concrete instance of `DomainConfigurationPtrInput` via: +// +// DomainConfigurationArgs{...} +// +// or: +// +// nil +type DomainConfigurationPtrInput interface { + pulumi.Input + + ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput + ToDomainConfigurationPtrOutputWithContext(context.Context) DomainConfigurationPtrOutput +} + +type domainConfigurationPtrType DomainConfigurationArgs + +func DomainConfigurationPtr(v *DomainConfigurationArgs) DomainConfigurationPtrInput { + return (*domainConfigurationPtrType)(v) +} + +func (*domainConfigurationPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**DomainConfiguration)(nil)).Elem() +} + +func (i *domainConfigurationPtrType) ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput { + return i.ToDomainConfigurationPtrOutputWithContext(context.Background()) +} + +func (i *domainConfigurationPtrType) ToDomainConfigurationPtrOutputWithContext(ctx context.Context) DomainConfigurationPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(DomainConfigurationPtrOutput) +} + +func (i *domainConfigurationPtrType) ToOutput(ctx context.Context) pulumix.Output[*DomainConfiguration] { + return pulumix.Output[*DomainConfiguration]{ + OutputState: i.ToDomainConfigurationPtrOutputWithContext(ctx).OutputState, + } +} + +// 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). +// +// > **Note:** This resource establishes ownership of and the TLS settings for +// a particular domain name. An API stage can be associated with the domain name using the `aws.apigatewayv2.ApiMapping` resource. +// +// ## 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.NewDomainName(ctx, "example", &apigatewayv2.DomainNameArgs{ +// DomainName: pulumi.String("ws-api.example.com"), +// DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ +// CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), +// EndpointType: pulumi.String("REGIONAL"), +// SecurityPolicy: pulumi.String("TLS_1_2"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Associated Route 53 Resource Record +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleDomainName, err := apigatewayv2.NewDomainName(ctx, "exampleDomainName", &apigatewayv2.DomainNameArgs{ +// DomainName: pulumi.String("http-api.example.com"), +// DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ +// CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), +// EndpointType: pulumi.String("REGIONAL"), +// SecurityPolicy: pulumi.String("TLS_1_2"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = route53.NewRecord(ctx, "exampleRecord", &route53.RecordArgs{ +// Name: exampleDomainName.DomainName, +// Type: pulumi.String("A"), +// ZoneId: pulumi.Any(aws_route53_zone.Example.Zone_id), +// Aliases: route53.RecordAliasArray{ +// &route53.RecordAliasArgs{ +// Name: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { +// return &domainNameConfiguration.TargetDomainName, nil +// }).(pulumi.StringPtrOutput), +// ZoneId: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { +// return &domainNameConfiguration.HostedZoneId, nil +// }).(pulumi.StringPtrOutput), +// EvaluateTargetHealth: pulumi.Bool(false), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// Using `pulumi import`, import `aws_apigatewayv2_domain_name` using the domain name. For example: +// +// ```sh +// +// $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com +// +// ``` +type DomainConfigurationOutput struct{ *pulumi.OutputState } + +func (DomainConfigurationOutput) ElementType() reflect.Type { + return reflect.TypeOf((*DomainConfiguration)(nil)).Elem() +} + +func (o DomainConfigurationOutput) ToDomainConfigurationOutput() DomainConfigurationOutput { + return o +} + +func (o DomainConfigurationOutput) ToDomainConfigurationOutputWithContext(ctx context.Context) DomainConfigurationOutput { + return o +} + +func (o DomainConfigurationOutput) ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput { + return o.ToDomainConfigurationPtrOutputWithContext(context.Background()) +} + +func (o DomainConfigurationOutput) ToDomainConfigurationPtrOutputWithContext(ctx context.Context) DomainConfigurationPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v DomainConfiguration) *DomainConfiguration { + return &v + }).(DomainConfigurationPtrOutput) +} + +func (o DomainConfigurationOutput) ToOutput(ctx context.Context) pulumix.Output[DomainConfiguration] { + return pulumix.Output[DomainConfiguration]{ + OutputState: o.OutputState, + } +} + +// Domain name configuration. See below. +func (o DomainConfigurationOutput) DomainNameConfiguration() apigatewayv2.DomainNameDomainNameConfigurationPtrOutput { + return o.ApplyT(func(v DomainConfiguration) *apigatewayv2.DomainNameDomainNameConfiguration { + return v.DomainNameConfiguration + }).(apigatewayv2.DomainNameDomainNameConfigurationPtrOutput) +} + +// 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) +} + +// 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) +} + +type DomainConfigurationPtrOutput struct{ *pulumi.OutputState } + +func (DomainConfigurationPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**DomainConfiguration)(nil)).Elem() +} + +func (o DomainConfigurationPtrOutput) ToDomainConfigurationPtrOutput() DomainConfigurationPtrOutput { + return o +} + +func (o DomainConfigurationPtrOutput) ToDomainConfigurationPtrOutputWithContext(ctx context.Context) DomainConfigurationPtrOutput { + return o +} + +func (o DomainConfigurationPtrOutput) ToOutput(ctx context.Context) pulumix.Output[*DomainConfiguration] { + return pulumix.Output[*DomainConfiguration]{ + OutputState: o.OutputState, + } +} + +func (o DomainConfigurationPtrOutput) Elem() DomainConfigurationOutput { + return o.ApplyT(func(v *DomainConfiguration) DomainConfiguration { + if v != nil { + return *v + } + var ret DomainConfiguration + return ret + }).(DomainConfigurationOutput) +} + +// Domain name configuration. See below. +func (o DomainConfigurationPtrOutput) DomainNameConfiguration() apigatewayv2.DomainNameDomainNameConfigurationPtrOutput { + return o.ApplyT(func(v *DomainConfiguration) *apigatewayv2.DomainNameDomainNameConfiguration { + if v == nil { + return nil + } + return v.DomainNameConfiguration + }).(apigatewayv2.DomainNameDomainNameConfigurationPtrOutput) +} + +// Mutual TLS authentication configuration for the domain name. +func (o DomainConfigurationPtrOutput) MutualTlsAuthentication() apigatewayv2.DomainNameMutualTlsAuthenticationPtrOutput { + return o.ApplyT(func(v *DomainConfiguration) *apigatewayv2.DomainNameMutualTlsAuthentication { + if v == nil { + return nil + } + 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 DomainConfigurationPtrOutput) Tags() pulumi.StringMapOutput { + return o.ApplyT(func(v *DomainConfiguration) map[string]string { + if v == nil { + return nil + } + return v.Tags + }).(pulumi.StringMapOutput) +} + +type DomainMapping struct { + // 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"` +} + +// 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 +} + +type DomainMappingArgs struct { + // Configuration of the domain name to create. Cannot be specified together with `domainId`. + DomainConfiguration DomainConfigurationPtrInput `pulumi:"domainConfiguration"` + // Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + DomainId pulumi.StringPtrInput `pulumi:"domainId"` +} + +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, + } +} + +// DomainMappingMapInput is an input type that accepts DomainMappingMap and DomainMappingMapOutput values. +// You can construct a concrete instance of `DomainMappingMapInput` via: +// +// DomainMappingMap{ "key": DomainMappingArgs{...} } +type DomainMappingMapInput interface { + pulumi.Input + + ToDomainMappingMapOutput() DomainMappingMapOutput + ToDomainMappingMapOutputWithContext(context.Context) DomainMappingMapOutput +} + +type DomainMappingMap map[string]DomainMappingInput + +func (DomainMappingMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]DomainMapping)(nil)).Elem() +} + +func (i DomainMappingMap) ToDomainMappingMapOutput() DomainMappingMapOutput { + return i.ToDomainMappingMapOutputWithContext(context.Background()) +} + +func (i DomainMappingMap) ToDomainMappingMapOutputWithContext(ctx context.Context) DomainMappingMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(DomainMappingMapOutput) +} + +func (i DomainMappingMap) ToOutput(ctx context.Context) pulumix.Output[map[string]DomainMapping] { + return pulumix.Output[map[string]DomainMapping]{ + OutputState: i.ToDomainMappingMapOutputWithContext(ctx).OutputState, + } +} + +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, + } +} + +// 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) +} + +type DomainMappingMapOutput struct{ *pulumi.OutputState } + +func (DomainMappingMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]DomainMapping)(nil)).Elem() +} + +func (o DomainMappingMapOutput) ToDomainMappingMapOutput() DomainMappingMapOutput { + return o +} + +func (o DomainMappingMapOutput) ToDomainMappingMapOutputWithContext(ctx context.Context) DomainMappingMapOutput { + return o +} + +func (o DomainMappingMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]DomainMapping] { + return pulumix.Output[map[string]DomainMapping]{ + OutputState: o.OutputState, + } +} + +func (o DomainMappingMapOutput) MapIndex(k pulumi.StringInput) DomainMappingOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) DomainMapping { + return vs[0].(map[string]DomainMapping)[vs[1].(string)] + }).(DomainMappingOutput) +} + +type HttpAuthorizer struct { +} + +// HttpAuthorizerInput is an input type that accepts HttpAuthorizerArgs and HttpAuthorizerOutput values. +// You can construct a concrete instance of `HttpAuthorizerInput` via: +// +// HttpAuthorizerArgs{...} +type HttpAuthorizerInput interface { + pulumi.Input + + ToHttpAuthorizerOutput() HttpAuthorizerOutput + ToHttpAuthorizerOutputWithContext(context.Context) HttpAuthorizerOutput +} + +type HttpAuthorizerArgs struct { +} + +func (HttpAuthorizerArgs) ElementType() reflect.Type { + return reflect.TypeOf((*HttpAuthorizer)(nil)).Elem() +} + +func (i HttpAuthorizerArgs) ToHttpAuthorizerOutput() HttpAuthorizerOutput { + return i.ToHttpAuthorizerOutputWithContext(context.Background()) +} + +func (i HttpAuthorizerArgs) ToHttpAuthorizerOutputWithContext(ctx context.Context) HttpAuthorizerOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpAuthorizerOutput) +} + +func (i HttpAuthorizerArgs) ToOutput(ctx context.Context) pulumix.Output[HttpAuthorizer] { + return pulumix.Output[HttpAuthorizer]{ + OutputState: i.ToHttpAuthorizerOutputWithContext(ctx).OutputState, + } +} + +// HttpAuthorizerMapInput is an input type that accepts HttpAuthorizerMap and HttpAuthorizerMapOutput values. +// You can construct a concrete instance of `HttpAuthorizerMapInput` via: +// +// HttpAuthorizerMap{ "key": HttpAuthorizerArgs{...} } +type HttpAuthorizerMapInput interface { + pulumi.Input + + ToHttpAuthorizerMapOutput() HttpAuthorizerMapOutput + ToHttpAuthorizerMapOutputWithContext(context.Context) HttpAuthorizerMapOutput +} + +type HttpAuthorizerMap map[string]HttpAuthorizerInput + +func (HttpAuthorizerMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]HttpAuthorizer)(nil)).Elem() +} + +func (i HttpAuthorizerMap) ToHttpAuthorizerMapOutput() HttpAuthorizerMapOutput { + return i.ToHttpAuthorizerMapOutputWithContext(context.Background()) +} + +func (i HttpAuthorizerMap) ToHttpAuthorizerMapOutputWithContext(ctx context.Context) HttpAuthorizerMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpAuthorizerMapOutput) +} + +func (i HttpAuthorizerMap) ToOutput(ctx context.Context) pulumix.Output[map[string]HttpAuthorizer] { + return pulumix.Output[map[string]HttpAuthorizer]{ + OutputState: i.ToHttpAuthorizerMapOutputWithContext(ctx).OutputState, + } +} + +type HttpAuthorizerOutput struct{ *pulumi.OutputState } + +func (HttpAuthorizerOutput) ElementType() reflect.Type { + return reflect.TypeOf((*HttpAuthorizer)(nil)).Elem() +} + +func (o HttpAuthorizerOutput) ToHttpAuthorizerOutput() HttpAuthorizerOutput { + return o +} + +func (o HttpAuthorizerOutput) ToHttpAuthorizerOutputWithContext(ctx context.Context) HttpAuthorizerOutput { + return o +} + +func (o HttpAuthorizerOutput) ToOutput(ctx context.Context) pulumix.Output[HttpAuthorizer] { + return pulumix.Output[HttpAuthorizer]{ + OutputState: o.OutputState, + } +} + +type HttpAuthorizerMapOutput struct{ *pulumi.OutputState } + +func (HttpAuthorizerMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]HttpAuthorizer)(nil)).Elem() +} + +func (o HttpAuthorizerMapOutput) ToHttpAuthorizerMapOutput() HttpAuthorizerMapOutput { + return o +} + +func (o HttpAuthorizerMapOutput) ToHttpAuthorizerMapOutputWithContext(ctx context.Context) HttpAuthorizerMapOutput { + return o +} + +func (o HttpAuthorizerMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]HttpAuthorizer] { + return pulumix.Output[map[string]HttpAuthorizer]{ + OutputState: o.OutputState, + } +} + +func (o HttpAuthorizerMapOutput) MapIndex(k pulumi.StringInput) HttpAuthorizerOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) HttpAuthorizer { + return vs[0].(map[string]HttpAuthorizer)[vs[1].(string)] + }).(HttpAuthorizerOutput) +} + +type HttpIntegration struct { +} + +// HttpIntegrationInput is an input type that accepts HttpIntegrationArgs and HttpIntegrationOutput values. +// You can construct a concrete instance of `HttpIntegrationInput` via: +// +// HttpIntegrationArgs{...} +type HttpIntegrationInput interface { + pulumi.Input + + ToHttpIntegrationOutput() HttpIntegrationOutput + ToHttpIntegrationOutputWithContext(context.Context) HttpIntegrationOutput +} + +type HttpIntegrationArgs struct { +} + +func (HttpIntegrationArgs) ElementType() reflect.Type { + return reflect.TypeOf((*HttpIntegration)(nil)).Elem() +} + +func (i HttpIntegrationArgs) ToHttpIntegrationOutput() HttpIntegrationOutput { + return i.ToHttpIntegrationOutputWithContext(context.Background()) +} + +func (i HttpIntegrationArgs) ToHttpIntegrationOutputWithContext(ctx context.Context) HttpIntegrationOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpIntegrationOutput) +} + +func (i HttpIntegrationArgs) ToOutput(ctx context.Context) pulumix.Output[HttpIntegration] { + return pulumix.Output[HttpIntegration]{ + OutputState: i.ToHttpIntegrationOutputWithContext(ctx).OutputState, + } +} + +// HttpIntegrationMapInput is an input type that accepts HttpIntegrationMap and HttpIntegrationMapOutput values. +// You can construct a concrete instance of `HttpIntegrationMapInput` via: +// +// HttpIntegrationMap{ "key": HttpIntegrationArgs{...} } +type HttpIntegrationMapInput interface { + pulumi.Input + + ToHttpIntegrationMapOutput() HttpIntegrationMapOutput + ToHttpIntegrationMapOutputWithContext(context.Context) HttpIntegrationMapOutput +} + +type HttpIntegrationMap map[string]HttpIntegrationInput + +func (HttpIntegrationMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]HttpIntegration)(nil)).Elem() +} + +func (i HttpIntegrationMap) ToHttpIntegrationMapOutput() HttpIntegrationMapOutput { + return i.ToHttpIntegrationMapOutputWithContext(context.Background()) +} + +func (i HttpIntegrationMap) ToHttpIntegrationMapOutputWithContext(ctx context.Context) HttpIntegrationMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpIntegrationMapOutput) +} + +func (i HttpIntegrationMap) ToOutput(ctx context.Context) pulumix.Output[map[string]HttpIntegration] { + return pulumix.Output[map[string]HttpIntegration]{ + OutputState: i.ToHttpIntegrationMapOutputWithContext(ctx).OutputState, + } +} + +type HttpIntegrationOutput struct{ *pulumi.OutputState } + +func (HttpIntegrationOutput) ElementType() reflect.Type { + return reflect.TypeOf((*HttpIntegration)(nil)).Elem() +} + +func (o HttpIntegrationOutput) ToHttpIntegrationOutput() HttpIntegrationOutput { + return o +} + +func (o HttpIntegrationOutput) ToHttpIntegrationOutputWithContext(ctx context.Context) HttpIntegrationOutput { + return o +} + +func (o HttpIntegrationOutput) ToOutput(ctx context.Context) pulumix.Output[HttpIntegration] { + return pulumix.Output[HttpIntegration]{ + OutputState: o.OutputState, + } +} + +type HttpIntegrationMapOutput struct{ *pulumi.OutputState } + +func (HttpIntegrationMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]HttpIntegration)(nil)).Elem() +} + +func (o HttpIntegrationMapOutput) ToHttpIntegrationMapOutput() HttpIntegrationMapOutput { + return o +} + +func (o HttpIntegrationMapOutput) ToHttpIntegrationMapOutputWithContext(ctx context.Context) HttpIntegrationMapOutput { + return o +} + +func (o HttpIntegrationMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]HttpIntegration] { + return pulumix.Output[map[string]HttpIntegration]{ + OutputState: o.OutputState, + } +} + +func (o HttpIntegrationMapOutput) MapIndex(k pulumi.StringInput) HttpIntegrationOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) HttpIntegration { + return vs[0].(map[string]HttpIntegration)[vs[1].(string)] + }).(HttpIntegrationOutput) +} + +type HttpRoute struct { + // The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + Authorizer *string `pulumi:"authorizer"` + // The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + Integration *string `pulumi:"integration"` +} + +// HttpRouteInput is an input type that accepts HttpRouteArgs and HttpRouteOutput values. +// You can construct a concrete instance of `HttpRouteInput` via: +// +// HttpRouteArgs{...} +type HttpRouteInput interface { + pulumi.Input + + ToHttpRouteOutput() HttpRouteOutput + ToHttpRouteOutputWithContext(context.Context) HttpRouteOutput +} + +type HttpRouteArgs struct { + // The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + Authorizer pulumi.StringPtrInput `pulumi:"authorizer"` + // The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + Integration pulumi.StringPtrInput `pulumi:"integration"` +} + +func (HttpRouteArgs) ElementType() reflect.Type { + return reflect.TypeOf((*HttpRoute)(nil)).Elem() +} + +func (i HttpRouteArgs) ToHttpRouteOutput() HttpRouteOutput { + return i.ToHttpRouteOutputWithContext(context.Background()) +} + +func (i HttpRouteArgs) ToHttpRouteOutputWithContext(ctx context.Context) HttpRouteOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpRouteOutput) +} + +func (i HttpRouteArgs) ToOutput(ctx context.Context) pulumix.Output[HttpRoute] { + return pulumix.Output[HttpRoute]{ + OutputState: i.ToHttpRouteOutputWithContext(ctx).OutputState, + } +} + +// HttpRouteMapInput is an input type that accepts HttpRouteMap and HttpRouteMapOutput values. +// You can construct a concrete instance of `HttpRouteMapInput` via: +// +// HttpRouteMap{ "key": HttpRouteArgs{...} } +type HttpRouteMapInput interface { + pulumi.Input + + ToHttpRouteMapOutput() HttpRouteMapOutput + ToHttpRouteMapOutputWithContext(context.Context) HttpRouteMapOutput +} + +type HttpRouteMap map[string]HttpRouteInput + +func (HttpRouteMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]HttpRoute)(nil)).Elem() +} + +func (i HttpRouteMap) ToHttpRouteMapOutput() HttpRouteMapOutput { + return i.ToHttpRouteMapOutputWithContext(context.Background()) +} + +func (i HttpRouteMap) ToHttpRouteMapOutputWithContext(ctx context.Context) HttpRouteMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpRouteMapOutput) +} + +func (i HttpRouteMap) ToOutput(ctx context.Context) pulumix.Output[map[string]HttpRoute] { + return pulumix.Output[map[string]HttpRoute]{ + OutputState: i.ToHttpRouteMapOutputWithContext(ctx).OutputState, + } +} + +type HttpRouteOutput struct{ *pulumi.OutputState } + +func (HttpRouteOutput) ElementType() reflect.Type { + return reflect.TypeOf((*HttpRoute)(nil)).Elem() +} + +func (o HttpRouteOutput) ToHttpRouteOutput() HttpRouteOutput { + return o +} + +func (o HttpRouteOutput) ToHttpRouteOutputWithContext(ctx context.Context) HttpRouteOutput { + return o +} + +func (o HttpRouteOutput) ToOutput(ctx context.Context) pulumix.Output[HttpRoute] { + return pulumix.Output[HttpRoute]{ + OutputState: o.OutputState, + } +} + +// The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. +func (o HttpRouteOutput) Authorizer() pulumi.StringPtrOutput { + return o.ApplyT(func(v HttpRoute) *string { return v.Authorizer }).(pulumi.StringPtrOutput) +} + +// The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. +func (o HttpRouteOutput) Integration() pulumi.StringPtrOutput { + return o.ApplyT(func(v HttpRoute) *string { return v.Integration }).(pulumi.StringPtrOutput) +} + +type HttpRouteMapOutput struct{ *pulumi.OutputState } + +func (HttpRouteMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]HttpRoute)(nil)).Elem() +} + +func (o HttpRouteMapOutput) ToHttpRouteMapOutput() HttpRouteMapOutput { + return o +} + +func (o HttpRouteMapOutput) ToHttpRouteMapOutputWithContext(ctx context.Context) HttpRouteMapOutput { + return o +} + +func (o HttpRouteMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]HttpRoute] { + return pulumix.Output[map[string]HttpRoute]{ + OutputState: o.OutputState, + } +} + +func (o HttpRouteMapOutput) MapIndex(k pulumi.StringInput) HttpRouteOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) HttpRoute { + return vs[0].(map[string]HttpRoute)[vs[1].(string)] + }).(HttpRouteOutput) +} + +type HttpStage struct { +} + +// HttpStageInput is an input type that accepts HttpStageArgs and HttpStageOutput values. +// You can construct a concrete instance of `HttpStageInput` via: +// +// HttpStageArgs{...} +type HttpStageInput interface { + pulumi.Input + + ToHttpStageOutput() HttpStageOutput + ToHttpStageOutputWithContext(context.Context) HttpStageOutput +} + +type HttpStageArgs struct { +} + +func (HttpStageArgs) ElementType() reflect.Type { + return reflect.TypeOf((*HttpStage)(nil)).Elem() +} + +func (i HttpStageArgs) ToHttpStageOutput() HttpStageOutput { + return i.ToHttpStageOutputWithContext(context.Background()) +} + +func (i HttpStageArgs) ToHttpStageOutputWithContext(ctx context.Context) HttpStageOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpStageOutput) +} + +func (i HttpStageArgs) ToOutput(ctx context.Context) pulumix.Output[HttpStage] { + return pulumix.Output[HttpStage]{ + OutputState: i.ToHttpStageOutputWithContext(ctx).OutputState, + } +} + +// HttpStageMapInput is an input type that accepts HttpStageMap and HttpStageMapOutput values. +// You can construct a concrete instance of `HttpStageMapInput` via: +// +// HttpStageMap{ "key": HttpStageArgs{...} } +type HttpStageMapInput interface { + pulumi.Input + + ToHttpStageMapOutput() HttpStageMapOutput + ToHttpStageMapOutputWithContext(context.Context) HttpStageMapOutput +} + +type HttpStageMap map[string]HttpStageInput + +func (HttpStageMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]HttpStage)(nil)).Elem() +} + +func (i HttpStageMap) ToHttpStageMapOutput() HttpStageMapOutput { + return i.ToHttpStageMapOutputWithContext(context.Background()) +} + +func (i HttpStageMap) ToHttpStageMapOutputWithContext(ctx context.Context) HttpStageMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(HttpStageMapOutput) +} + +func (i HttpStageMap) ToOutput(ctx context.Context) pulumix.Output[map[string]HttpStage] { + return pulumix.Output[map[string]HttpStage]{ + OutputState: i.ToHttpStageMapOutputWithContext(ctx).OutputState, + } +} + +type HttpStageOutput struct{ *pulumi.OutputState } + +func (HttpStageOutput) ElementType() reflect.Type { + return reflect.TypeOf((*HttpStage)(nil)).Elem() +} + +func (o HttpStageOutput) ToHttpStageOutput() HttpStageOutput { + return o +} + +func (o HttpStageOutput) ToHttpStageOutputWithContext(ctx context.Context) HttpStageOutput { + return o +} + +func (o HttpStageOutput) ToOutput(ctx context.Context) pulumix.Output[HttpStage] { + return pulumix.Output[HttpStage]{ + OutputState: o.OutputState, + } +} + +type HttpStageMapOutput struct{ *pulumi.OutputState } + +func (HttpStageMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]HttpStage)(nil)).Elem() +} + +func (o HttpStageMapOutput) ToHttpStageMapOutput() HttpStageMapOutput { + return o +} + +func (o HttpStageMapOutput) ToHttpStageMapOutputWithContext(ctx context.Context) HttpStageMapOutput { + return o +} + +func (o HttpStageMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]HttpStage] { + return pulumix.Output[map[string]HttpStage]{ + OutputState: o.OutputState, + } +} + +func (o HttpStageMapOutput) MapIndex(k pulumi.StringInput) HttpStageOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) HttpStage { + return vs[0].(map[string]HttpStage)[vs[1].(string)] + }).(HttpStageOutput) +} + +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((*DomainMappingMapInput)(nil)).Elem(), DomainMappingMap{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpAuthorizerInput)(nil)).Elem(), HttpAuthorizerArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpAuthorizerMapInput)(nil)).Elem(), HttpAuthorizerMap{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpIntegrationInput)(nil)).Elem(), HttpIntegrationArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpIntegrationMapInput)(nil)).Elem(), HttpIntegrationMap{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpRouteInput)(nil)).Elem(), HttpRouteArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpRouteMapInput)(nil)).Elem(), HttpRouteMap{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpStageInput)(nil)).Elem(), HttpStageArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*HttpStageMapInput)(nil)).Elem(), HttpStageMap{}) + pulumi.RegisterOutputType(DomainConfigurationOutput{}) + pulumi.RegisterOutputType(DomainConfigurationPtrOutput{}) + pulumi.RegisterOutputType(DomainMappingOutput{}) + pulumi.RegisterOutputType(DomainMappingMapOutput{}) + pulumi.RegisterOutputType(HttpAuthorizerOutput{}) + pulumi.RegisterOutputType(HttpAuthorizerMapOutput{}) + pulumi.RegisterOutputType(HttpIntegrationOutput{}) + pulumi.RegisterOutputType(HttpIntegrationMapOutput{}) + pulumi.RegisterOutputType(HttpRouteOutput{}) + pulumi.RegisterOutputType(HttpRouteMapOutput{}) + pulumi.RegisterOutputType(HttpStageOutput{}) + pulumi.RegisterOutputType(HttpStageMapOutput{}) +} diff --git a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/HttpApi.java b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/HttpApi.java new file mode 100644 index 000000000..bc14061ca --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/HttpApi.java @@ -0,0 +1,190 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.awsx.apigatewayv2; + +import com.pulumi.aws.apigatewayv2.Api; +import com.pulumi.aws.apigatewayv2.ApiMapping; +import com.pulumi.aws.apigatewayv2.Authorizer; +import com.pulumi.aws.apigatewayv2.Deployment; +import com.pulumi.aws.apigatewayv2.DomainName; +import com.pulumi.aws.apigatewayv2.Integration; +import com.pulumi.aws.apigatewayv2.Route; +import com.pulumi.aws.apigatewayv2.Stage; +import com.pulumi.awsx.Utilities; +import com.pulumi.awsx.apigatewayv2.HttpApiArgs; +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Export; +import com.pulumi.core.annotations.ResourceType; +import com.pulumi.core.internal.Codegen; +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +/** + * Creates an HTTP API with associated sub-resources. + * + */ +@ResourceType(type="awsx:apigatewayv2:HttpApi") +public class HttpApi extends com.pulumi.resources.CustomResource { + /** + * The underlying API resource. + * + */ + @Export(name="api", refs={Api.class}, tree="[0]") + private Output api; + + /** + * @return The underlying API resource. + * + */ + public Output api() { + return this.api; + } + /** + * The API mappings for the HTTP API. + * + */ + @Export(name="apiMappings", refs={List.class,ApiMapping.class}, tree="[0,1]") + private Output> apiMappings; + + /** + * @return The API mappings for the HTTP API. + * + */ + public Output>> apiMappings() { + return Codegen.optional(this.apiMappings); + } + /** + * The authorizers for the HTTP API routes. + * + */ + @Export(name="authorizers", refs={List.class,Authorizer.class}, tree="[0,1]") + private Output> authorizers; + + /** + * @return The authorizers for the HTTP API routes. + * + */ + public Output> authorizers() { + return this.authorizers; + } + /** + * The deployment for the HTTP API. + * + */ + @Export(name="deployment", refs={Deployment.class}, tree="[0]") + private Output deployment; + + /** + * @return The deployment for the HTTP API. + * + */ + public Output deployment() { + return this.deployment; + } + /** + * The domain names for the HTTP API. + * + */ + @Export(name="domainNames", refs={List.class,DomainName.class}, tree="[0,1]") + private Output> domainNames; + + /** + * @return The domain names for the HTTP API. + * + */ + public Output> domainNames() { + return this.domainNames; + } + /** + * The integrations for the HTTP API routes. This is a map from integration name to the integration arguments. + * + */ + @Export(name="integrations", refs={List.class,Integration.class}, tree="[0,1]") + private Output> integrations; + + /** + * @return The integrations for the HTTP API routes. This is a map from integration name to the integration arguments. + * + */ + public Output> integrations() { + return this.integrations; + } + /** + * The routes for the HTTP API. This is a map from route key (for example `GET /pets`) to route arguments. + * + */ + @Export(name="routes", refs={List.class,Route.class}, tree="[0,1]") + private Output> routes; + + /** + * @return The routes for the HTTP API. This is a map from route key (for example `GET /pets`) to route arguments. + * + */ + public Output> routes() { + return this.routes; + } + /** + * The deployment stages for the HTTP API. + * + */ + @Export(name="stages", refs={List.class,Stage.class}, tree="[0,1]") + private Output> stages; + + /** + * @return The deployment stages for the HTTP API. + * + */ + public Output> stages() { + return this.stages; + } + + /** + * + * @param name The _unique_ name of the resulting resource. + */ + public HttpApi(String name) { + this(name, HttpApiArgs.Empty); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + */ + public HttpApi(String name, HttpApiArgs args) { + this(name, args, null); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + * @param options A bag of options that control this resource's behavior. + */ + public HttpApi(String name, HttpApiArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("awsx:apigatewayv2:HttpApi", name, args == null ? HttpApiArgs.Empty : args, makeResourceOptions(options, Codegen.empty())); + } + + private HttpApi(String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("awsx:apigatewayv2:HttpApi", name, null, makeResourceOptions(options, id)); + } + + private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { + var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() + .version(Utilities.getVersion()) + .build(); + return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); + } + + /** + * Get an existing Host resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param options Optional settings to control the behavior of the CustomResource. + */ + public static HttpApi get(String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { + return new HttpApi(name, id, options); + } +} diff --git a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/HttpApiArgs.java b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/HttpApiArgs.java new file mode 100644 index 000000000..5bcfe06d6 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/HttpApiArgs.java @@ -0,0 +1,630 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.awsx.apigatewayv2; + +import com.pulumi.aws.apigatewayv2.inputs.ApiCorsConfigurationArgs; +import com.pulumi.awsx.apigatewayv2.inputs.DomainMappingArgs; +import com.pulumi.awsx.apigatewayv2.inputs.HttpAuthorizerArgs; +import com.pulumi.awsx.apigatewayv2.inputs.HttpIntegrationArgs; +import com.pulumi.awsx.apigatewayv2.inputs.HttpRouteArgs; +import com.pulumi.awsx.apigatewayv2.inputs.HttpStageArgs; +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.Boolean; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class HttpApiArgs extends com.pulumi.resources.ResourceArgs { + + public static final HttpApiArgs Empty = new HttpApiArgs(); + + /** + * An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + * Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + * Applicable for WebSocket APIs. + * + */ + @Import(name="apiKeySelectionExpression") + private @Nullable Output apiKeySelectionExpression; + + /** + * @return An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + * Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + * Applicable for WebSocket APIs. + * + */ + public Optional> apiKeySelectionExpression() { + return Optional.ofNullable(this.apiKeySelectionExpression); + } + + /** + * The authorizers for the HTTP API routes. + * + */ + @Import(name="authorizers") + private @Nullable Output> authorizers; + + /** + * @return The authorizers for the HTTP API routes. + * + */ + public Optional>> authorizers() { + return Optional.ofNullable(this.authorizers); + } + + /** + * An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + * + */ + @Import(name="body") + private @Nullable Output body; + + /** + * @return An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + * + */ + public Optional> body() { + return Optional.ofNullable(this.body); + } + + /** + * Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + * + */ + @Import(name="corsConfiguration") + private @Nullable Output corsConfiguration; + + /** + * @return Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + * + */ + public Optional> corsConfiguration() { + return Optional.ofNullable(this.corsConfiguration); + } + + /** + * Description of the API. Must be less than or equal to 1024 characters in length. + * + */ + @Import(name="description") + private @Nullable Output description; + + /** + * @return Description of the API. Must be less than or equal to 1024 characters in length. + * + */ + public Optional> description() { + return Optional.ofNullable(this.description); + } + + /** + * Whether clients can invoke the API by using the default `execute-api` endpoint. + * By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + * To require that clients use a custom domain name to invoke the API, disable the default endpoint. + * + */ + @Import(name="disableExecuteApiEndpoint") + private @Nullable Output disableExecuteApiEndpoint; + + /** + * @return Whether clients can invoke the API by using the default `execute-api` endpoint. + * By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + * To require that clients use a custom domain name to invoke the API, disable the default endpoint. + * + */ + public Optional> disableExecuteApiEndpoint() { + return Optional.ofNullable(this.disableExecuteApiEndpoint); + } + + /** + * The domain names for the HTTP API. + * + */ + @Import(name="domainMappings") + private @Nullable Output> domainMappings; + + /** + * @return The domain names for the HTTP API. + * + */ + public Optional>> domainMappings() { + return Optional.ofNullable(this.domainMappings); + } + + /** + * Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + * + */ + @Import(name="failOnWarnings") + private @Nullable Output failOnWarnings; + + /** + * @return Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + * + */ + public Optional> failOnWarnings() { + return Optional.ofNullable(this.failOnWarnings); + } + + /** + * The integrations for the HTTP API routes. + * + */ + @Import(name="integrations") + private @Nullable Output> integrations; + + /** + * @return The integrations for the HTTP API routes. + * + */ + public Optional>> integrations() { + return Optional.ofNullable(this.integrations); + } + + /** + * Name of the API. Must be less than or equal to 128 characters in length. + * + */ + @Import(name="name") + private @Nullable Output name; + + /** + * @return Name of the API. Must be less than or equal to 128 characters in length. + * + */ + public Optional> name() { + return Optional.ofNullable(this.name); + } + + /** + * The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + * Defaults to `$request.method $request.path`. + * + */ + @Import(name="routeSelectionExpression") + private @Nullable Output routeSelectionExpression; + + /** + * @return The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + * Defaults to `$request.method $request.path`. + * + */ + public Optional> routeSelectionExpression() { + return Optional.ofNullable(this.routeSelectionExpression); + } + + /** + * The routes for the HTTP API. + * + */ + @Import(name="routes", required=true) + private Output> routes; + + /** + * @return The routes for the HTTP API. + * + */ + public Output> routes() { + return this.routes; + } + + /** + * The deployment stages for the HTTP API. + * + */ + @Import(name="stages") + private @Nullable Output> stages; + + /** + * @return The deployment stages for the HTTP API. + * + */ + public Optional>> stages() { + return Optional.ofNullable(this.stages); + } + + /** + * Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + * + */ + @Import(name="tags") + private @Nullable Output> tags; + + /** + * @return Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + * + */ + public Optional>> tags() { + return Optional.ofNullable(this.tags); + } + + /** + * Version identifier for the API. Must be between 1 and 64 characters in length. + * + */ + @Import(name="version") + private @Nullable Output version; + + /** + * @return Version identifier for the API. Must be between 1 and 64 characters in length. + * + */ + public Optional> version() { + return Optional.ofNullable(this.version); + } + + private HttpApiArgs() {} + + private HttpApiArgs(HttpApiArgs $) { + this.apiKeySelectionExpression = $.apiKeySelectionExpression; + this.authorizers = $.authorizers; + this.body = $.body; + this.corsConfiguration = $.corsConfiguration; + this.description = $.description; + this.disableExecuteApiEndpoint = $.disableExecuteApiEndpoint; + this.domainMappings = $.domainMappings; + this.failOnWarnings = $.failOnWarnings; + this.integrations = $.integrations; + this.name = $.name; + this.routeSelectionExpression = $.routeSelectionExpression; + this.routes = $.routes; + this.stages = $.stages; + this.tags = $.tags; + this.version = $.version; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(HttpApiArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private HttpApiArgs $; + + public Builder() { + $ = new HttpApiArgs(); + } + + public Builder(HttpApiArgs defaults) { + $ = new HttpApiArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param apiKeySelectionExpression An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + * Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + * Applicable for WebSocket APIs. + * + * @return builder + * + */ + public Builder apiKeySelectionExpression(@Nullable Output apiKeySelectionExpression) { + $.apiKeySelectionExpression = apiKeySelectionExpression; + return this; + } + + /** + * @param apiKeySelectionExpression An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + * Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + * Applicable for WebSocket APIs. + * + * @return builder + * + */ + public Builder apiKeySelectionExpression(String apiKeySelectionExpression) { + return apiKeySelectionExpression(Output.of(apiKeySelectionExpression)); + } + + /** + * @param authorizers The authorizers for the HTTP API routes. + * + * @return builder + * + */ + public Builder authorizers(@Nullable Output> authorizers) { + $.authorizers = authorizers; + return this; + } + + /** + * @param authorizers The authorizers for the HTTP API routes. + * + * @return builder + * + */ + public Builder authorizers(Map authorizers) { + return authorizers(Output.of(authorizers)); + } + + /** + * @param body An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + * + * @return builder + * + */ + public Builder body(@Nullable Output body) { + $.body = body; + return this; + } + + /** + * @param body An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + * + * @return builder + * + */ + public Builder body(String body) { + return body(Output.of(body)); + } + + /** + * @param corsConfiguration Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + * + * @return builder + * + */ + public Builder corsConfiguration(@Nullable Output corsConfiguration) { + $.corsConfiguration = corsConfiguration; + return this; + } + + /** + * @param corsConfiguration Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + * + * @return builder + * + */ + public Builder corsConfiguration(ApiCorsConfigurationArgs corsConfiguration) { + return corsConfiguration(Output.of(corsConfiguration)); + } + + /** + * @param description Description of the API. Must be less than or equal to 1024 characters in length. + * + * @return builder + * + */ + public Builder description(@Nullable Output description) { + $.description = description; + return this; + } + + /** + * @param description Description of the API. Must be less than or equal to 1024 characters in length. + * + * @return builder + * + */ + public Builder description(String description) { + return description(Output.of(description)); + } + + /** + * @param disableExecuteApiEndpoint Whether clients can invoke the API by using the default `execute-api` endpoint. + * By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + * To require that clients use a custom domain name to invoke the API, disable the default endpoint. + * + * @return builder + * + */ + public Builder disableExecuteApiEndpoint(@Nullable Output disableExecuteApiEndpoint) { + $.disableExecuteApiEndpoint = disableExecuteApiEndpoint; + return this; + } + + /** + * @param disableExecuteApiEndpoint Whether clients can invoke the API by using the default `execute-api` endpoint. + * By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + * To require that clients use a custom domain name to invoke the API, disable the default endpoint. + * + * @return builder + * + */ + public Builder disableExecuteApiEndpoint(Boolean disableExecuteApiEndpoint) { + return disableExecuteApiEndpoint(Output.of(disableExecuteApiEndpoint)); + } + + /** + * @param domainMappings The domain names for the HTTP API. + * + * @return builder + * + */ + public Builder domainMappings(@Nullable Output> domainMappings) { + $.domainMappings = domainMappings; + return this; + } + + /** + * @param domainMappings The domain names for the HTTP API. + * + * @return builder + * + */ + public Builder domainMappings(Map domainMappings) { + return domainMappings(Output.of(domainMappings)); + } + + /** + * @param failOnWarnings Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + * + * @return builder + * + */ + public Builder failOnWarnings(@Nullable Output failOnWarnings) { + $.failOnWarnings = failOnWarnings; + return this; + } + + /** + * @param failOnWarnings Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + * + * @return builder + * + */ + public Builder failOnWarnings(Boolean failOnWarnings) { + return failOnWarnings(Output.of(failOnWarnings)); + } + + /** + * @param integrations The integrations for the HTTP API routes. + * + * @return builder + * + */ + public Builder integrations(@Nullable Output> integrations) { + $.integrations = integrations; + return this; + } + + /** + * @param integrations The integrations for the HTTP API routes. + * + * @return builder + * + */ + public Builder integrations(Map integrations) { + return integrations(Output.of(integrations)); + } + + /** + * @param name Name of the API. Must be less than or equal to 128 characters in length. + * + * @return builder + * + */ + public Builder name(@Nullable Output name) { + $.name = name; + return this; + } + + /** + * @param name Name of the API. Must be less than or equal to 128 characters in length. + * + * @return builder + * + */ + public Builder name(String name) { + return name(Output.of(name)); + } + + /** + * @param routeSelectionExpression The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + * Defaults to `$request.method $request.path`. + * + * @return builder + * + */ + public Builder routeSelectionExpression(@Nullable Output routeSelectionExpression) { + $.routeSelectionExpression = routeSelectionExpression; + return this; + } + + /** + * @param routeSelectionExpression The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + * Defaults to `$request.method $request.path`. + * + * @return builder + * + */ + public Builder routeSelectionExpression(String routeSelectionExpression) { + return routeSelectionExpression(Output.of(routeSelectionExpression)); + } + + /** + * @param routes The routes for the HTTP API. + * + * @return builder + * + */ + public Builder routes(Output> routes) { + $.routes = routes; + return this; + } + + /** + * @param routes The routes for the HTTP API. + * + * @return builder + * + */ + public Builder routes(Map routes) { + return routes(Output.of(routes)); + } + + /** + * @param stages The deployment stages for the HTTP API. + * + * @return builder + * + */ + public Builder stages(@Nullable Output> stages) { + $.stages = stages; + return this; + } + + /** + * @param stages The deployment stages for the HTTP API. + * + * @return builder + * + */ + public Builder stages(Map stages) { + return stages(Output.of(stages)); + } + + /** + * @param tags Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + * + * @return builder + * + */ + public Builder tags(@Nullable Output> tags) { + $.tags = tags; + return this; + } + + /** + * @param tags Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + * + * @return builder + * + */ + public Builder tags(Map tags) { + return tags(Output.of(tags)); + } + + /** + * @param version Version identifier for the API. Must be between 1 and 64 characters in length. + * + * @return builder + * + */ + public Builder version(@Nullable Output version) { + $.version = version; + return this; + } + + /** + * @param version Version identifier for the API. Must be between 1 and 64 characters in length. + * + * @return builder + * + */ + public Builder version(String version) { + return version(Output.of(version)); + } + + public HttpApiArgs build() { + $.routes = Objects.requireNonNull($.routes, "expected parameter 'routes' to be non-null"); + return $; + } + } + +} 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/DomainConfigurationArgs.java new file mode 100644 index 000000000..8c8232bd2 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainConfigurationArgs.java @@ -0,0 +1,262 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.awsx.apigatewayv2.inputs; + +import com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs; +import com.pulumi.aws.apigatewayv2.inputs.DomainNameMutualTlsAuthenticationArgs; +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +/** + * 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). + * + * > **Note:** This resource establishes ownership of and the TLS settings for + * a particular domain name. An API stage can be associated with the domain name using the `aws.apigatewayv2.ApiMapping` resource. + * + * ## Example Usage + * ### Basic + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.aws.apigatewayv2.DomainName; + * import com.pulumi.aws.apigatewayv2.DomainNameArgs; + * import com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs; + * 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 DomainName("example", DomainNameArgs.builder() + * .domainName("ws-api.example.com") + * .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder() + * .certificateArn(aws_acm_certificate.example().arn()) + * .endpointType("REGIONAL") + * .securityPolicy("TLS_1_2") + * .build()) + * .build()); + * + * } + * } + * ``` + * ### Associated Route 53 Resource Record + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.aws.apigatewayv2.DomainName; + * import com.pulumi.aws.apigatewayv2.DomainNameArgs; + * import com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs; + * import com.pulumi.aws.route53.Record; + * import com.pulumi.aws.route53.RecordArgs; + * import com.pulumi.aws.route53.inputs.RecordAliasArgs; + * 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 exampleDomainName = new DomainName("exampleDomainName", DomainNameArgs.builder() + * .domainName("http-api.example.com") + * .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder() + * .certificateArn(aws_acm_certificate.example().arn()) + * .endpointType("REGIONAL") + * .securityPolicy("TLS_1_2") + * .build()) + * .build()); + * + * var exampleRecord = new Record("exampleRecord", RecordArgs.builder() + * .name(exampleDomainName.domainName()) + * .type("A") + * .zoneId(aws_route53_zone.example().zone_id()) + * .aliases(RecordAliasArgs.builder() + * .name(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -> domainNameConfiguration.targetDomainName())) + * .zoneId(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -> domainNameConfiguration.hostedZoneId())) + * .evaluateTargetHealth(false) + * .build()) + * .build()); + * + * } + * } + * ``` + * + * ## Import + * + * Using `pulumi import`, import `aws_apigatewayv2_domain_name` using the domain name. For example: + * + * ```sh + * $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com + * ``` + * + */ +public final class DomainConfigurationArgs extends com.pulumi.resources.ResourceArgs { + + public static final DomainConfigurationArgs Empty = new DomainConfigurationArgs(); + + /** + * Domain name configuration. See below. + * + */ + @Import(name="domainNameConfiguration") + private @Nullable Output domainNameConfiguration; + + /** + * @return Domain name configuration. See below. + * + */ + public Optional> domainNameConfiguration() { + return Optional.ofNullable(this.domainNameConfiguration); + } + + /** + * Mutual TLS authentication configuration for the domain name. + * + */ + @Import(name="mutualTlsAuthentication") + private @Nullable Output mutualTlsAuthentication; + + /** + * @return Mutual TLS authentication configuration for the domain name. + * + */ + public Optional> mutualTlsAuthentication() { + return Optional.ofNullable(this.mutualTlsAuthentication); + } + + /** + * 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. + * + */ + @Import(name="tags") + private @Nullable Output> tags; + + /** + * @return 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. + * + */ + public Optional>> tags() { + return Optional.ofNullable(this.tags); + } + + private DomainConfigurationArgs() {} + + private DomainConfigurationArgs(DomainConfigurationArgs $) { + this.domainNameConfiguration = $.domainNameConfiguration; + this.mutualTlsAuthentication = $.mutualTlsAuthentication; + this.tags = $.tags; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(DomainConfigurationArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private DomainConfigurationArgs $; + + public Builder() { + $ = new DomainConfigurationArgs(); + } + + public Builder(DomainConfigurationArgs defaults) { + $ = new DomainConfigurationArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param domainNameConfiguration Domain name configuration. See below. + * + * @return builder + * + */ + public Builder domainNameConfiguration(@Nullable Output domainNameConfiguration) { + $.domainNameConfiguration = domainNameConfiguration; + return this; + } + + /** + * @param domainNameConfiguration Domain name configuration. See below. + * + * @return builder + * + */ + public Builder domainNameConfiguration(DomainNameDomainNameConfigurationArgs domainNameConfiguration) { + return domainNameConfiguration(Output.of(domainNameConfiguration)); + } + + /** + * @param mutualTlsAuthentication Mutual TLS authentication configuration for the domain name. + * + * @return builder + * + */ + public Builder mutualTlsAuthentication(@Nullable Output mutualTlsAuthentication) { + $.mutualTlsAuthentication = mutualTlsAuthentication; + return this; + } + + /** + * @param mutualTlsAuthentication Mutual TLS authentication configuration for the domain name. + * + * @return builder + * + */ + public Builder mutualTlsAuthentication(DomainNameMutualTlsAuthenticationArgs mutualTlsAuthentication) { + return mutualTlsAuthentication(Output.of(mutualTlsAuthentication)); + } + + /** + * @param tags 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. + * + * @return builder + * + */ + public Builder tags(@Nullable Output> tags) { + $.tags = tags; + return this; + } + + /** + * @param tags 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. + * + * @return builder + * + */ + public Builder tags(Map tags) { + return tags(Output.of(tags)); + } + + public DomainConfigurationArgs build() { + return $; + } + } + +} 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 new file mode 100644 index 000000000..ea29a5976 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/DomainMappingArgs.java @@ -0,0 +1,121 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.awsx.apigatewayv2.inputs; + +import com.pulumi.awsx.apigatewayv2.inputs.DomainConfigurationArgs; +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class DomainMappingArgs extends com.pulumi.resources.ResourceArgs { + + public static final DomainMappingArgs Empty = new DomainMappingArgs(); + + /** + * Configuration of the domain name to create. Cannot be specified together with `domainId`. + * + */ + @Import(name="domainConfiguration") + private @Nullable Output domainConfiguration; + + /** + * @return Configuration of the domain name to create. Cannot be specified together with `domainId`. + * + */ + public Optional> domainConfiguration() { + return Optional.ofNullable(this.domainConfiguration); + } + + /** + * Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + * + */ + @Import(name="domainId") + private @Nullable Output domainId; + + /** + * @return Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + * + */ + public Optional> domainId() { + return Optional.ofNullable(this.domainId); + } + + private DomainMappingArgs() {} + + private DomainMappingArgs(DomainMappingArgs $) { + this.domainConfiguration = $.domainConfiguration; + this.domainId = $.domainId; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(DomainMappingArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private DomainMappingArgs $; + + public Builder() { + $ = new DomainMappingArgs(); + } + + public Builder(DomainMappingArgs defaults) { + $ = new DomainMappingArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param domainConfiguration Configuration of the domain name to create. Cannot be specified together with `domainId`. + * + * @return builder + * + */ + public Builder domainConfiguration(@Nullable Output domainConfiguration) { + $.domainConfiguration = domainConfiguration; + return this; + } + + /** + * @param domainConfiguration Configuration of the domain name to create. Cannot be specified together with `domainId`. + * + * @return builder + * + */ + public Builder domainConfiguration(DomainConfigurationArgs domainConfiguration) { + return domainConfiguration(Output.of(domainConfiguration)); + } + + /** + * @param domainId Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + * + * @return builder + * + */ + public Builder domainId(@Nullable Output domainId) { + $.domainId = domainId; + return this; + } + + /** + * @param domainId Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + * + * @return builder + * + */ + public Builder domainId(String domainId) { + return domainId(Output.of(domainId)); + } + + public DomainMappingArgs build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpAuthorizerArgs.java b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpAuthorizerArgs.java new file mode 100644 index 000000000..50360508d --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpAuthorizerArgs.java @@ -0,0 +1,28 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.awsx.apigatewayv2.inputs; + + + + +public final class HttpAuthorizerArgs extends com.pulumi.resources.ResourceArgs { + + public static final HttpAuthorizerArgs Empty = new HttpAuthorizerArgs(); + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + private HttpAuthorizerArgs $; + + public Builder() { + $ = new HttpAuthorizerArgs(); + } + public HttpAuthorizerArgs build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpIntegrationArgs.java b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpIntegrationArgs.java new file mode 100644 index 000000000..6266597ed --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpIntegrationArgs.java @@ -0,0 +1,28 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.awsx.apigatewayv2.inputs; + + + + +public final class HttpIntegrationArgs extends com.pulumi.resources.ResourceArgs { + + public static final HttpIntegrationArgs Empty = new HttpIntegrationArgs(); + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + private HttpIntegrationArgs $; + + public Builder() { + $ = new HttpIntegrationArgs(); + } + public HttpIntegrationArgs build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpRouteArgs.java b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpRouteArgs.java new file mode 100644 index 000000000..9f39c5f1e --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpRouteArgs.java @@ -0,0 +1,120 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.awsx.apigatewayv2.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class HttpRouteArgs extends com.pulumi.resources.ResourceArgs { + + public static final HttpRouteArgs Empty = new HttpRouteArgs(); + + /** + * The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + * + */ + @Import(name="authorizer") + private @Nullable Output authorizer; + + /** + * @return The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + * + */ + public Optional> authorizer() { + return Optional.ofNullable(this.authorizer); + } + + /** + * The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + * + */ + @Import(name="integration") + private @Nullable Output integration; + + /** + * @return The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + * + */ + public Optional> integration() { + return Optional.ofNullable(this.integration); + } + + private HttpRouteArgs() {} + + private HttpRouteArgs(HttpRouteArgs $) { + this.authorizer = $.authorizer; + this.integration = $.integration; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(HttpRouteArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private HttpRouteArgs $; + + public Builder() { + $ = new HttpRouteArgs(); + } + + public Builder(HttpRouteArgs defaults) { + $ = new HttpRouteArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param authorizer The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + * + * @return builder + * + */ + public Builder authorizer(@Nullable Output authorizer) { + $.authorizer = authorizer; + return this; + } + + /** + * @param authorizer The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + * + * @return builder + * + */ + public Builder authorizer(String authorizer) { + return authorizer(Output.of(authorizer)); + } + + /** + * @param integration The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + * + * @return builder + * + */ + public Builder integration(@Nullable Output integration) { + $.integration = integration; + return this; + } + + /** + * @param integration The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + * + * @return builder + * + */ + public Builder integration(String integration) { + return integration(Output.of(integration)); + } + + public HttpRouteArgs build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpStageArgs.java b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpStageArgs.java new file mode 100644 index 000000000..496ed793a --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/awsx/apigatewayv2/inputs/HttpStageArgs.java @@ -0,0 +1,28 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.awsx.apigatewayv2.inputs; + + + + +public final class HttpStageArgs extends com.pulumi.resources.ResourceArgs { + + public static final HttpStageArgs Empty = new HttpStageArgs(); + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + private HttpStageArgs $; + + public Builder() { + $ = new HttpStageArgs(); + } + public HttpStageArgs build() { + return $; + } + } + +} diff --git a/sdk/nodejs/apigatewayv2/httpApi.ts b/sdk/nodejs/apigatewayv2/httpApi.ts new file mode 100644 index 000000000..574a5cf0a --- /dev/null +++ b/sdk/nodejs/apigatewayv2/httpApi.ts @@ -0,0 +1,192 @@ +// *** WARNING: this file was generated by pulumi-gen-awsx. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import * as inputs from "../types/input"; +import * as outputs from "../types/output"; +import * as enums from "../types/enums"; +import * as utilities from "../utilities"; + +import * as pulumiAws from "@pulumi/aws"; + +/** + * Creates an HTTP API with associated sub-resources. + */ +export class HttpApi extends pulumi.CustomResource { + /** + * Get an existing HttpApi resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, opts?: pulumi.CustomResourceOptions): HttpApi { + return new HttpApi(name, undefined as any, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'awsx:apigatewayv2:HttpApi'; + + /** + * Returns true if the given object is an instance of HttpApi. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is HttpApi { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === HttpApi.__pulumiType; + } + + /** + * The underlying API resource. + */ + public /*out*/ readonly api!: pulumi.Output; + /** + * The API mappings for the HTTP API. + */ + public /*out*/ readonly apiMappings!: pulumi.Output; + /** + * The authorizers for the HTTP API routes. + */ + public readonly authorizers!: pulumi.Output; + /** + * The deployment for the HTTP API. + */ + public /*out*/ readonly deployment!: pulumi.Output; + /** + * The domain names for the HTTP API. + */ + public /*out*/ readonly domainNames!: pulumi.Output; + /** + * The integrations for the HTTP API routes. This is a map from integration name to the integration arguments. + */ + public readonly integrations!: pulumi.Output; + /** + * The routes for the HTTP API. This is a map from route key (for example `GET /pets`) to route arguments. + */ + public readonly routes!: pulumi.Output; + /** + * The deployment stages for the HTTP API. + */ + public readonly stages!: pulumi.Output; + + /** + * Create a HttpApi resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args: HttpApiArgs, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (!opts.id) { + if ((!args || args.routes === undefined) && !opts.urn) { + throw new Error("Missing required property 'routes'"); + } + resourceInputs["apiKeySelectionExpression"] = args ? args.apiKeySelectionExpression : undefined; + resourceInputs["authorizers"] = args ? args.authorizers : undefined; + resourceInputs["body"] = args ? args.body : undefined; + resourceInputs["corsConfiguration"] = args ? args.corsConfiguration : undefined; + resourceInputs["description"] = args ? args.description : undefined; + resourceInputs["disableExecuteApiEndpoint"] = args ? args.disableExecuteApiEndpoint : undefined; + resourceInputs["domainMappings"] = args ? args.domainMappings : undefined; + resourceInputs["failOnWarnings"] = args ? args.failOnWarnings : undefined; + resourceInputs["integrations"] = args ? args.integrations : undefined; + resourceInputs["name"] = args ? args.name : undefined; + resourceInputs["routeSelectionExpression"] = args ? args.routeSelectionExpression : undefined; + resourceInputs["routes"] = args ? args.routes : undefined; + resourceInputs["stages"] = args ? args.stages : undefined; + resourceInputs["tags"] = args ? args.tags : undefined; + resourceInputs["version"] = args ? args.version : undefined; + resourceInputs["api"] = undefined /*out*/; + resourceInputs["apiMappings"] = undefined /*out*/; + resourceInputs["deployment"] = undefined /*out*/; + resourceInputs["domainNames"] = undefined /*out*/; + } else { + resourceInputs["api"] = undefined /*out*/; + resourceInputs["apiMappings"] = undefined /*out*/; + resourceInputs["authorizers"] = undefined /*out*/; + resourceInputs["deployment"] = undefined /*out*/; + resourceInputs["domainNames"] = undefined /*out*/; + resourceInputs["integrations"] = undefined /*out*/; + resourceInputs["routes"] = undefined /*out*/; + resourceInputs["stages"] = undefined /*out*/; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + super(HttpApi.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * The set of arguments for constructing a HttpApi resource. + */ +export interface HttpApiArgs { + /** + * An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + * Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + * Applicable for WebSocket APIs. + */ + apiKeySelectionExpression?: pulumi.Input; + /** + * The authorizers for the HTTP API routes. + */ + authorizers?: pulumi.Input<{[key: string]: pulumi.Input}>; + /** + * An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + */ + body?: pulumi.Input; + /** + * Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + */ + corsConfiguration?: pulumi.Input; + /** + * Description of the API. Must be less than or equal to 1024 characters in length. + */ + description?: pulumi.Input; + /** + * Whether clients can invoke the API by using the default `execute-api` endpoint. + * By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + * To require that clients use a custom domain name to invoke the API, disable the default endpoint. + */ + disableExecuteApiEndpoint?: pulumi.Input; + /** + * The domain names for the HTTP API. + */ + domainMappings?: pulumi.Input<{[key: string]: pulumi.Input}>; + /** + * Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + */ + failOnWarnings?: pulumi.Input; + /** + * The integrations for the HTTP API routes. + */ + integrations?: pulumi.Input<{[key: string]: pulumi.Input}>; + /** + * Name of the API. Must be less than or equal to 128 characters in length. + */ + name?: pulumi.Input; + /** + * The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + * Defaults to `$request.method $request.path`. + */ + routeSelectionExpression?: pulumi.Input; + /** + * The routes for the HTTP API. + */ + routes: pulumi.Input<{[key: string]: pulumi.Input}>; + /** + * The deployment stages for the HTTP API. + */ + stages?: pulumi.Input<{[key: string]: pulumi.Input}>; + /** + * Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + */ + tags?: pulumi.Input<{[key: string]: pulumi.Input}>; + /** + * Version identifier for the API. Must be between 1 and 64 characters in length. + */ + version?: pulumi.Input; +} diff --git a/sdk/nodejs/apigatewayv2/index.ts b/sdk/nodejs/apigatewayv2/index.ts new file mode 100644 index 000000000..78b05e999 --- /dev/null +++ b/sdk/nodejs/apigatewayv2/index.ts @@ -0,0 +1,25 @@ +// *** WARNING: this file was generated by pulumi-gen-awsx. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import * as utilities from "../utilities"; + +// Export members: +export { HttpApiArgs } from "./httpApi"; +export type HttpApi = import("./httpApi").HttpApi; +export const HttpApi: typeof import("./httpApi").HttpApi = null as any; +utilities.lazyLoad(exports, ["HttpApi"], () => require("./httpApi")); + + +const _module = { + version: utilities.getVersion(), + construct: (name: string, type: string, urn: string): pulumi.Resource => { + switch (type) { + case "awsx:apigatewayv2:HttpApi": + return new HttpApi(name, undefined, { urn }) + default: + throw new Error(`unknown resource type ${type}`); + } + }, +}; +pulumi.runtime.registerResourceModule("awsx", "apigatewayv2", _module) diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 76a9625b9..348ec214e 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -12,6 +12,7 @@ utilities.lazyLoad(exports, ["Provider"], () => require("./provider")); // Export sub-modules: +import * as apigatewayv2 from "./apigatewayv2"; import * as classic from "./classic"; import * as cloudtrail from "./cloudtrail"; import * as ec2 from "./ec2"; @@ -21,6 +22,7 @@ import * as lb from "./lb"; import * as types from "./types"; export { + apigatewayv2, classic, cloudtrail, ec2, diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 213e9bce6..a43e0914e 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -13,6 +13,8 @@ "strict": true }, "files": [ + "apigatewayv2/httpApi.ts", + "apigatewayv2/index.ts", "classic/acmpca/index.ts", "classic/acmpca/metrics.ts", "classic/apigateway/api.ts", diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index 3fd0cc932..47964043c 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -9,6 +9,393 @@ import * as enums from "../types/enums"; import * as pulumiAws from "@pulumi/aws"; import * as utilities from "../utilities"; +export namespace apigatewayv2 { + /** + * 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). + * + * > **Note:** This resource establishes ownership of and the TLS settings for + * a particular domain name. An API stage can be associated with the domain name using the `aws.apigatewayv2.ApiMapping` resource. + * + * {{% examples %}} + * ## Example Usage + * {{% example %}} + * ### Basic + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as aws from "@pulumi/aws"; + * + * const example = new aws.apigatewayv2.DomainName("example", { + * domainName: "ws-api.example.com", + * domainNameConfiguration: { + * certificateArn: aws_acm_certificate.example.arn, + * endpointType: "REGIONAL", + * securityPolicy: "TLS_1_2", + * }, + * }); + * ``` + * ```python + * import pulumi + * import pulumi_aws as aws + * + * example = aws.apigatewayv2.DomainName("example", + * domain_name="ws-api.example.com", + * domain_name_configuration=aws.apigatewayv2.DomainNameDomainNameConfigurationArgs( + * certificate_arn=aws_acm_certificate["example"]["arn"], + * endpoint_type="REGIONAL", + * security_policy="TLS_1_2", + * )) + * ``` + * ```csharp + * using System.Collections.Generic; + * using System.Linq; + * using Pulumi; + * using Aws = Pulumi.Aws; + * + * return await Deployment.RunAsync(() => + * { + * var example = new Aws.ApiGatewayV2.DomainName("example", new() + * { + * Domain = "ws-api.example.com", + * DomainNameConfiguration = new Aws.ApiGatewayV2.Inputs.DomainNameDomainNameConfigurationArgs + * { + * CertificateArn = aws_acm_certificate.Example.Arn, + * EndpointType = "REGIONAL", + * SecurityPolicy = "TLS_1_2", + * }, + * }); + * + * }); + * ``` + * ```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.NewDomainName(ctx, "example", &apigatewayv2.DomainNameArgs{ + * DomainName: pulumi.String("ws-api.example.com"), + * DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ + * CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), + * EndpointType: pulumi.String("REGIONAL"), + * SecurityPolicy: pulumi.String("TLS_1_2"), + * }, + * }) + * 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.DomainName; + * import com.pulumi.aws.apigatewayv2.DomainNameArgs; + * import com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs; + * 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 DomainName("example", DomainNameArgs.builder() + * .domainName("ws-api.example.com") + * .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder() + * .certificateArn(aws_acm_certificate.example().arn()) + * .endpointType("REGIONAL") + * .securityPolicy("TLS_1_2") + * .build()) + * .build()); + * + * } + * } + * ``` + * ```yaml + * resources: + * example: + * type: aws:apigatewayv2:DomainName + * properties: + * domainName: ws-api.example.com + * domainNameConfiguration: + * certificateArn: ${aws_acm_certificate.example.arn} + * endpointType: REGIONAL + * securityPolicy: TLS_1_2 + * ``` + * {{% /example %}} + * {{% example %}} + * ### Associated Route 53 Resource Record + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as aws from "@pulumi/aws"; + * + * const exampleDomainName = new aws.apigatewayv2.DomainName("exampleDomainName", { + * domainName: "http-api.example.com", + * domainNameConfiguration: { + * certificateArn: aws_acm_certificate.example.arn, + * endpointType: "REGIONAL", + * securityPolicy: "TLS_1_2", + * }, + * }); + * const exampleRecord = new aws.route53.Record("exampleRecord", { + * name: exampleDomainName.domainName, + * type: "A", + * zoneId: aws_route53_zone.example.zone_id, + * aliases: [{ + * name: exampleDomainName.domainNameConfiguration.apply(domainNameConfiguration => domainNameConfiguration.targetDomainName), + * zoneId: exampleDomainName.domainNameConfiguration.apply(domainNameConfiguration => domainNameConfiguration.hostedZoneId), + * evaluateTargetHealth: false, + * }], + * }); + * ``` + * ```python + * import pulumi + * import pulumi_aws as aws + * + * example_domain_name = aws.apigatewayv2.DomainName("exampleDomainName", + * domain_name="http-api.example.com", + * domain_name_configuration=aws.apigatewayv2.DomainNameDomainNameConfigurationArgs( + * certificate_arn=aws_acm_certificate["example"]["arn"], + * endpoint_type="REGIONAL", + * security_policy="TLS_1_2", + * )) + * example_record = aws.route53.Record("exampleRecord", + * name=example_domain_name.domain_name, + * type="A", + * zone_id=aws_route53_zone["example"]["zone_id"], + * aliases=[aws.route53.RecordAliasArgs( + * name=example_domain_name.domain_name_configuration.target_domain_name, + * zone_id=example_domain_name.domain_name_configuration.hosted_zone_id, + * evaluate_target_health=False, + * )]) + * ``` + * ```csharp + * using System.Collections.Generic; + * using System.Linq; + * using Pulumi; + * using Aws = Pulumi.Aws; + * + * return await Deployment.RunAsync(() => + * { + * var exampleDomainName = new Aws.ApiGatewayV2.DomainName("exampleDomainName", new() + * { + * Domain = "http-api.example.com", + * DomainNameConfiguration = new Aws.ApiGatewayV2.Inputs.DomainNameDomainNameConfigurationArgs + * { + * CertificateArn = aws_acm_certificate.Example.Arn, + * EndpointType = "REGIONAL", + * SecurityPolicy = "TLS_1_2", + * }, + * }); + * + * var exampleRecord = new Aws.Route53.Record("exampleRecord", new() + * { + * Name = exampleDomainName.Domain, + * Type = "A", + * ZoneId = aws_route53_zone.Example.Zone_id, + * Aliases = new[] + * { + * new Aws.Route53.Inputs.RecordAliasArgs + * { + * Name = exampleDomainName.DomainNameConfiguration.Apply(domainNameConfiguration => domainNameConfiguration.TargetDomainName), + * ZoneId = exampleDomainName.DomainNameConfiguration.Apply(domainNameConfiguration => domainNameConfiguration.HostedZoneId), + * EvaluateTargetHealth = false, + * }, + * }, + * }); + * + * }); + * ``` + * ```go + * package main + * + * import ( + * "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" + * "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53" + * "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + * ) + * + * func main() { + * pulumi.Run(func(ctx *pulumi.Context) error { + * exampleDomainName, err := apigatewayv2.NewDomainName(ctx, "exampleDomainName", &apigatewayv2.DomainNameArgs{ + * DomainName: pulumi.String("http-api.example.com"), + * DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ + * CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), + * EndpointType: pulumi.String("REGIONAL"), + * SecurityPolicy: pulumi.String("TLS_1_2"), + * }, + * }) + * if err != nil { + * return err + * } + * _, err = route53.NewRecord(ctx, "exampleRecord", &route53.RecordArgs{ + * Name: exampleDomainName.DomainName, + * Type: pulumi.String("A"), + * ZoneId: pulumi.Any(aws_route53_zone.Example.Zone_id), + * Aliases: route53.RecordAliasArray{ + * &route53.RecordAliasArgs{ + * Name: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { + * return &domainNameConfiguration.TargetDomainName, nil + * }).(pulumi.StringPtrOutput), + * ZoneId: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { + * return &domainNameConfiguration.HostedZoneId, nil + * }).(pulumi.StringPtrOutput), + * EvaluateTargetHealth: pulumi.Bool(false), + * }, + * }, + * }) + * 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.DomainName; + * import com.pulumi.aws.apigatewayv2.DomainNameArgs; + * import com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs; + * import com.pulumi.aws.route53.Record; + * import com.pulumi.aws.route53.RecordArgs; + * import com.pulumi.aws.route53.inputs.RecordAliasArgs; + * 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 exampleDomainName = new DomainName("exampleDomainName", DomainNameArgs.builder() + * .domainName("http-api.example.com") + * .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder() + * .certificateArn(aws_acm_certificate.example().arn()) + * .endpointType("REGIONAL") + * .securityPolicy("TLS_1_2") + * .build()) + * .build()); + * + * var exampleRecord = new Record("exampleRecord", RecordArgs.builder() + * .name(exampleDomainName.domainName()) + * .type("A") + * .zoneId(aws_route53_zone.example().zone_id()) + * .aliases(RecordAliasArgs.builder() + * .name(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -> domainNameConfiguration.targetDomainName())) + * .zoneId(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -> domainNameConfiguration.hostedZoneId())) + * .evaluateTargetHealth(false) + * .build()) + * .build()); + * + * } + * } + * ``` + * ```yaml + * resources: + * exampleDomainName: + * type: aws:apigatewayv2:DomainName + * properties: + * domainName: http-api.example.com + * domainNameConfiguration: + * certificateArn: ${aws_acm_certificate.example.arn} + * endpointType: REGIONAL + * securityPolicy: TLS_1_2 + * exampleRecord: + * type: aws:route53:Record + * properties: + * name: ${exampleDomainName.domainName} + * type: A + * zoneId: ${aws_route53_zone.example.zone_id} + * aliases: + * - name: ${exampleDomainName.domainNameConfiguration.targetDomainName} + * zoneId: ${exampleDomainName.domainNameConfiguration.hostedZoneId} + * evaluateTargetHealth: false + * ``` + * {{% /example %}} + * {{% /examples %}} + * + * ## Import + * + * Using `pulumi import`, import `aws_apigatewayv2_domain_name` using the domain name. For example: + * + * ```sh + * $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com + * ``` + * + */ + export interface DomainConfigurationArgs { + /** + * Domain name configuration. See below. + */ + domainNameConfiguration?: pulumi.Input; + /** + * Mutual TLS authentication configuration for the domain name. + */ + mutualTlsAuthentication?: pulumi.Input; + /** + * 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. + */ + tags?: pulumi.Input<{[key: string]: pulumi.Input}>; + } + + export interface DomainMappingArgs { + /** + * Configuration of the domain name to create. Cannot be specified together with `domainId`. + */ + domainConfiguration?: pulumi.Input; + /** + * Identifier of an existing domain. Cannot be specified together with `domainConfiguration`. + */ + domainId?: pulumi.Input; + } + + export interface HttpAuthorizerArgs { + } + + export interface HttpIntegrationArgs { + } + + export interface HttpRouteArgs { + /** + * The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + */ + authorizer?: pulumi.Input; + /** + * The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + */ + integration?: pulumi.Input; + } + + export interface HttpStageArgs { + } +} + export namespace awsx { /** * The set of arguments for constructing a Bucket resource. diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 437dc6cc3..524647817 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -9,6 +9,9 @@ import * as enums from "../types/enums"; import * as pulumiAws from "@pulumi/aws"; import * as utilities from "../utilities"; +export namespace apigatewayv2 { +} + export namespace awsx { } diff --git a/sdk/python/pulumi_awsx/__init__.py b/sdk/python/pulumi_awsx/__init__.py index 6032a297f..3e64a78aa 100644 --- a/sdk/python/pulumi_awsx/__init__.py +++ b/sdk/python/pulumi_awsx/__init__.py @@ -9,6 +9,8 @@ # Make subpackages available: if typing.TYPE_CHECKING: + import pulumi_awsx.apigatewayv2 as __apigatewayv2 + apigatewayv2 = __apigatewayv2 import pulumi_awsx.awsx as __awsx awsx = __awsx import pulumi_awsx.cloudtrail as __cloudtrail @@ -22,6 +24,7 @@ import pulumi_awsx.lb as __lb lb = __lb else: + apigatewayv2 = _utilities.lazy_import('pulumi_awsx.apigatewayv2') awsx = _utilities.lazy_import('pulumi_awsx.awsx') cloudtrail = _utilities.lazy_import('pulumi_awsx.cloudtrail') ec2 = _utilities.lazy_import('pulumi_awsx.ec2') @@ -32,6 +35,14 @@ _utilities.register( resource_modules=""" [ + { + "pkg": "awsx", + "mod": "apigatewayv2", + "fqn": "pulumi_awsx.apigatewayv2", + "classes": { + "awsx:apigatewayv2:HttpApi": "HttpApi" + } + }, { "pkg": "awsx", "mod": "cloudtrail", diff --git a/sdk/python/pulumi_awsx/apigatewayv2/__init__.py b/sdk/python/pulumi_awsx/apigatewayv2/__init__.py new file mode 100644 index 000000000..62029935f --- /dev/null +++ b/sdk/python/pulumi_awsx/apigatewayv2/__init__.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# *** WARNING: this file was generated by pulumi-gen-awsx. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +from .. import _utilities +import typing +# Export this package's modules as members: +from .http_api import * +from ._inputs import * diff --git a/sdk/python/pulumi_awsx/apigatewayv2/_inputs.py b/sdk/python/pulumi_awsx/apigatewayv2/_inputs.py new file mode 100644 index 000000000..6910bed6e --- /dev/null +++ b/sdk/python/pulumi_awsx/apigatewayv2/_inputs.py @@ -0,0 +1,509 @@ +# coding=utf-8 +# *** WARNING: this file was generated by pulumi-gen-awsx. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from .. import _utilities +import pulumi_aws + +__all__ = [ + 'DomainConfigurationArgs', + 'DomainMappingArgs', + 'HttpAuthorizerArgs', + 'HttpIntegrationArgs', + 'HttpRouteArgs', + 'HttpStageArgs', +] + +@pulumi.input_type +class DomainConfigurationArgs: + def __init__(__self__, *, + domain_name_configuration: Optional[pulumi.Input['pulumi_aws.apigatewayv2.DomainNameDomainNameConfigurationArgs']] = None, + mutual_tls_authentication: Optional[pulumi.Input['pulumi_aws.apigatewayv2.DomainNameMutualTlsAuthenticationArgs']] = None, + tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None): + """ + 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). + + > **Note:** This resource establishes ownership of and the TLS settings for + a particular domain name. An API stage can be associated with the domain name using the `aws.apigatewayv2.ApiMapping` resource. + + {{% examples %}} + ## Example Usage + {{% example %}} + ### Basic + + ```typescript + import * as pulumi from "@pulumi/pulumi"; + import * as aws from "@pulumi/aws"; + + const example = new aws.apigatewayv2.DomainName("example", { + domainName: "ws-api.example.com", + domainNameConfiguration: { + certificateArn: aws_acm_certificate.example.arn, + endpointType: "REGIONAL", + securityPolicy: "TLS_1_2", + }, + }); + ``` + ```python + import pulumi + import pulumi_aws as aws + + example = aws.apigatewayv2.DomainName("example", + domain_name="ws-api.example.com", + domain_name_configuration=aws.apigatewayv2.DomainNameDomainNameConfigurationArgs( + certificate_arn=aws_acm_certificate["example"]["arn"], + endpoint_type="REGIONAL", + security_policy="TLS_1_2", + )) + ``` + ```csharp + using System.Collections.Generic; + using System.Linq; + using Pulumi; + using Aws = Pulumi.Aws; + + return await Deployment.RunAsync(() => + { + var example = new Aws.ApiGatewayV2.DomainName("example", new() + { + Domain = "ws-api.example.com", + DomainNameConfiguration = new Aws.ApiGatewayV2.Inputs.DomainNameDomainNameConfigurationArgs + { + CertificateArn = aws_acm_certificate.Example.Arn, + EndpointType = "REGIONAL", + SecurityPolicy = "TLS_1_2", + }, + }); + + }); + ``` + ```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.NewDomainName(ctx, "example", &apigatewayv2.DomainNameArgs{ + DomainName: pulumi.String("ws-api.example.com"), + DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ + CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), + EndpointType: pulumi.String("REGIONAL"), + SecurityPolicy: pulumi.String("TLS_1_2"), + }, + }) + 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.DomainName; + import com.pulumi.aws.apigatewayv2.DomainNameArgs; + import com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs; + 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 DomainName("example", DomainNameArgs.builder() + .domainName("ws-api.example.com") + .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder() + .certificateArn(aws_acm_certificate.example().arn()) + .endpointType("REGIONAL") + .securityPolicy("TLS_1_2") + .build()) + .build()); + + } + } + ``` + ```yaml + resources: + example: + type: aws:apigatewayv2:DomainName + properties: + domainName: ws-api.example.com + domainNameConfiguration: + certificateArn: ${aws_acm_certificate.example.arn} + endpointType: REGIONAL + securityPolicy: TLS_1_2 + ``` + {{% /example %}} + {{% example %}} + ### Associated Route 53 Resource Record + + ```typescript + import * as pulumi from "@pulumi/pulumi"; + import * as aws from "@pulumi/aws"; + + const exampleDomainName = new aws.apigatewayv2.DomainName("exampleDomainName", { + domainName: "http-api.example.com", + domainNameConfiguration: { + certificateArn: aws_acm_certificate.example.arn, + endpointType: "REGIONAL", + securityPolicy: "TLS_1_2", + }, + }); + const exampleRecord = new aws.route53.Record("exampleRecord", { + name: exampleDomainName.domainName, + type: "A", + zoneId: aws_route53_zone.example.zone_id, + aliases: [{ + name: exampleDomainName.domainNameConfiguration.apply(domainNameConfiguration => domainNameConfiguration.targetDomainName), + zoneId: exampleDomainName.domainNameConfiguration.apply(domainNameConfiguration => domainNameConfiguration.hostedZoneId), + evaluateTargetHealth: false, + }], + }); + ``` + ```python + import pulumi + import pulumi_aws as aws + + example_domain_name = aws.apigatewayv2.DomainName("exampleDomainName", + domain_name="http-api.example.com", + domain_name_configuration=aws.apigatewayv2.DomainNameDomainNameConfigurationArgs( + certificate_arn=aws_acm_certificate["example"]["arn"], + endpoint_type="REGIONAL", + security_policy="TLS_1_2", + )) + example_record = aws.route53.Record("exampleRecord", + name=example_domain_name.domain_name, + type="A", + zone_id=aws_route53_zone["example"]["zone_id"], + aliases=[aws.route53.RecordAliasArgs( + name=example_domain_name.domain_name_configuration.target_domain_name, + zone_id=example_domain_name.domain_name_configuration.hosted_zone_id, + evaluate_target_health=False, + )]) + ``` + ```csharp + using System.Collections.Generic; + using System.Linq; + using Pulumi; + using Aws = Pulumi.Aws; + + return await Deployment.RunAsync(() => + { + var exampleDomainName = new Aws.ApiGatewayV2.DomainName("exampleDomainName", new() + { + Domain = "http-api.example.com", + DomainNameConfiguration = new Aws.ApiGatewayV2.Inputs.DomainNameDomainNameConfigurationArgs + { + CertificateArn = aws_acm_certificate.Example.Arn, + EndpointType = "REGIONAL", + SecurityPolicy = "TLS_1_2", + }, + }); + + var exampleRecord = new Aws.Route53.Record("exampleRecord", new() + { + Name = exampleDomainName.Domain, + Type = "A", + ZoneId = aws_route53_zone.Example.Zone_id, + Aliases = new[] + { + new Aws.Route53.Inputs.RecordAliasArgs + { + Name = exampleDomainName.DomainNameConfiguration.Apply(domainNameConfiguration => domainNameConfiguration.TargetDomainName), + ZoneId = exampleDomainName.DomainNameConfiguration.Apply(domainNameConfiguration => domainNameConfiguration.HostedZoneId), + EvaluateTargetHealth = false, + }, + }, + }); + + }); + ``` + ```go + package main + + import ( + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + ) + + func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + exampleDomainName, err := apigatewayv2.NewDomainName(ctx, "exampleDomainName", &apigatewayv2.DomainNameArgs{ + DomainName: pulumi.String("http-api.example.com"), + DomainNameConfiguration: &apigatewayv2.DomainNameDomainNameConfigurationArgs{ + CertificateArn: pulumi.Any(aws_acm_certificate.Example.Arn), + EndpointType: pulumi.String("REGIONAL"), + SecurityPolicy: pulumi.String("TLS_1_2"), + }, + }) + if err != nil { + return err + } + _, err = route53.NewRecord(ctx, "exampleRecord", &route53.RecordArgs{ + Name: exampleDomainName.DomainName, + Type: pulumi.String("A"), + ZoneId: pulumi.Any(aws_route53_zone.Example.Zone_id), + Aliases: route53.RecordAliasArray{ + &route53.RecordAliasArgs{ + Name: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { + return &domainNameConfiguration.TargetDomainName, nil + }).(pulumi.StringPtrOutput), + ZoneId: exampleDomainName.DomainNameConfiguration.ApplyT(func(domainNameConfiguration apigatewayv2.DomainNameDomainNameConfiguration) (*string, error) { + return &domainNameConfiguration.HostedZoneId, nil + }).(pulumi.StringPtrOutput), + EvaluateTargetHealth: pulumi.Bool(false), + }, + }, + }) + 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.DomainName; + import com.pulumi.aws.apigatewayv2.DomainNameArgs; + import com.pulumi.aws.apigatewayv2.inputs.DomainNameDomainNameConfigurationArgs; + import com.pulumi.aws.route53.Record; + import com.pulumi.aws.route53.RecordArgs; + import com.pulumi.aws.route53.inputs.RecordAliasArgs; + 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 exampleDomainName = new DomainName("exampleDomainName", DomainNameArgs.builder() + .domainName("http-api.example.com") + .domainNameConfiguration(DomainNameDomainNameConfigurationArgs.builder() + .certificateArn(aws_acm_certificate.example().arn()) + .endpointType("REGIONAL") + .securityPolicy("TLS_1_2") + .build()) + .build()); + + var exampleRecord = new Record("exampleRecord", RecordArgs.builder() + .name(exampleDomainName.domainName()) + .type("A") + .zoneId(aws_route53_zone.example().zone_id()) + .aliases(RecordAliasArgs.builder() + .name(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -> domainNameConfiguration.targetDomainName())) + .zoneId(exampleDomainName.domainNameConfiguration().applyValue(domainNameConfiguration -> domainNameConfiguration.hostedZoneId())) + .evaluateTargetHealth(false) + .build()) + .build()); + + } + } + ``` + ```yaml + resources: + exampleDomainName: + type: aws:apigatewayv2:DomainName + properties: + domainName: http-api.example.com + domainNameConfiguration: + certificateArn: ${aws_acm_certificate.example.arn} + endpointType: REGIONAL + securityPolicy: TLS_1_2 + exampleRecord: + type: aws:route53:Record + properties: + name: ${exampleDomainName.domainName} + type: A + zoneId: ${aws_route53_zone.example.zone_id} + aliases: + - name: ${exampleDomainName.domainNameConfiguration.targetDomainName} + zoneId: ${exampleDomainName.domainNameConfiguration.hostedZoneId} + evaluateTargetHealth: false + ``` + {{% /example %}} + {{% /examples %}} + + ## Import + + Using `pulumi import`, import `aws_apigatewayv2_domain_name` using the domain name. For example: + + ```sh + $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com + ``` + + :param pulumi.Input['pulumi_aws.apigatewayv2.DomainNameDomainNameConfigurationArgs'] domain_name_configuration: Domain name configuration. See below. + :param pulumi.Input['pulumi_aws.apigatewayv2.DomainNameMutualTlsAuthenticationArgs'] mutual_tls_authentication: Mutual TLS authentication configuration for the domain name. + :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: 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. + """ + if domain_name_configuration is not None: + pulumi.set(__self__, "domain_name_configuration", domain_name_configuration) + if mutual_tls_authentication is not None: + pulumi.set(__self__, "mutual_tls_authentication", mutual_tls_authentication) + if tags is not None: + pulumi.set(__self__, "tags", tags) + + @property + @pulumi.getter(name="domainNameConfiguration") + def domain_name_configuration(self) -> Optional[pulumi.Input['pulumi_aws.apigatewayv2.DomainNameDomainNameConfigurationArgs']]: + """ + Domain name configuration. See below. + """ + return pulumi.get(self, "domain_name_configuration") + + @domain_name_configuration.setter + def domain_name_configuration(self, value: Optional[pulumi.Input['pulumi_aws.apigatewayv2.DomainNameDomainNameConfigurationArgs']]): + pulumi.set(self, "domain_name_configuration", value) + + @property + @pulumi.getter(name="mutualTlsAuthentication") + def mutual_tls_authentication(self) -> Optional[pulumi.Input['pulumi_aws.apigatewayv2.DomainNameMutualTlsAuthenticationArgs']]: + """ + Mutual TLS authentication configuration for the domain name. + """ + return pulumi.get(self, "mutual_tls_authentication") + + @mutual_tls_authentication.setter + def mutual_tls_authentication(self, value: Optional[pulumi.Input['pulumi_aws.apigatewayv2.DomainNameMutualTlsAuthenticationArgs']]): + pulumi.set(self, "mutual_tls_authentication", value) + + @property + @pulumi.getter + def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: + """ + 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. + """ + return pulumi.get(self, "tags") + + @tags.setter + 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__, *, + domain_configuration: Optional[pulumi.Input['DomainConfigurationArgs']] = None, + domain_id: Optional[pulumi.Input[str]] = None): + """ + :param pulumi.Input['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`. + """ + 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(name="domainConfiguration") + def domain_configuration(self) -> Optional[pulumi.Input['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[pulumi.Input['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__): + pass + + +@pulumi.input_type +class HttpIntegrationArgs: + def __init__(__self__): + pass + + +@pulumi.input_type +class HttpRouteArgs: + def __init__(__self__, *, + authorizer: Optional[pulumi.Input[str]] = None, + integration: Optional[pulumi.Input[str]] = None): + """ + :param pulumi.Input[str] authorizer: The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + :param pulumi.Input[str] integration: The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + """ + if authorizer is not None: + pulumi.set(__self__, "authorizer", authorizer) + if integration is not None: + pulumi.set(__self__, "integration", integration) + + @property + @pulumi.getter + def authorizer(self) -> Optional[pulumi.Input[str]]: + """ + The key of the target authorizer for the route specified in the `authorizers` property. This is used to automatically calculate the `authorizerId` property of the route. + """ + return pulumi.get(self, "authorizer") + + @authorizer.setter + def authorizer(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "authorizer", value) + + @property + @pulumi.getter + def integration(self) -> Optional[pulumi.Input[str]]: + """ + The key of the target integration for the route specified in the `integrations` property. This is used to automatically calculate the `target` property of the route. One of `integration` or `target` must be specified. + """ + return pulumi.get(self, "integration") + + @integration.setter + def integration(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "integration", value) + + +@pulumi.input_type +class HttpStageArgs: + def __init__(__self__): + pass + + diff --git a/sdk/python/pulumi_awsx/apigatewayv2/http_api.py b/sdk/python/pulumi_awsx/apigatewayv2/http_api.py new file mode 100644 index 000000000..c970cd06d --- /dev/null +++ b/sdk/python/pulumi_awsx/apigatewayv2/http_api.py @@ -0,0 +1,484 @@ +# coding=utf-8 +# *** WARNING: this file was generated by pulumi-gen-awsx. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from .. import _utilities +from ._inputs import * +import pulumi_aws + +__all__ = ['HttpApiArgs', 'HttpApi'] + +@pulumi.input_type +class HttpApiArgs: + def __init__(__self__, *, + routes: pulumi.Input[Mapping[str, pulumi.Input['HttpRouteArgs']]], + api_key_selection_expression: Optional[pulumi.Input[str]] = None, + authorizers: Optional[pulumi.Input[Mapping[str, pulumi.Input['HttpAuthorizerArgs']]]] = None, + body: Optional[pulumi.Input[str]] = None, + cors_configuration: Optional[pulumi.Input['pulumi_aws.apigatewayv2.ApiCorsConfigurationArgs']] = None, + description: Optional[pulumi.Input[str]] = None, + disable_execute_api_endpoint: Optional[pulumi.Input[bool]] = None, + domain_mappings: Optional[pulumi.Input[Mapping[str, pulumi.Input['DomainMappingArgs']]]] = None, + fail_on_warnings: Optional[pulumi.Input[bool]] = None, + integrations: Optional[pulumi.Input[Mapping[str, pulumi.Input['HttpIntegrationArgs']]]] = None, + name: Optional[pulumi.Input[str]] = None, + route_selection_expression: Optional[pulumi.Input[str]] = None, + stages: Optional[pulumi.Input[Mapping[str, pulumi.Input['HttpStageArgs']]]] = None, + tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, + version: Optional[pulumi.Input[str]] = None): + """ + The set of arguments for constructing a HttpApi resource. + :param pulumi.Input[Mapping[str, pulumi.Input['HttpRouteArgs']]] routes: The routes for the HTTP API. + :param pulumi.Input[str] api_key_selection_expression: An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + Applicable for WebSocket APIs. + :param pulumi.Input[Mapping[str, pulumi.Input['HttpAuthorizerArgs']]] authorizers: The authorizers for the HTTP API routes. + :param pulumi.Input[str] body: An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + :param pulumi.Input['pulumi_aws.apigatewayv2.ApiCorsConfigurationArgs'] cors_configuration: Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + :param pulumi.Input[str] description: Description of the API. Must be less than or equal to 1024 characters in length. + :param pulumi.Input[bool] disable_execute_api_endpoint: Whether clients can invoke the API by using the default `execute-api` endpoint. + By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + To require that clients use a custom domain name to invoke the API, disable the default endpoint. + :param pulumi.Input[Mapping[str, pulumi.Input['DomainMappingArgs']]] domain_mappings: The domain names for the HTTP API. + :param pulumi.Input[bool] fail_on_warnings: Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + :param pulumi.Input[Mapping[str, pulumi.Input['HttpIntegrationArgs']]] integrations: The integrations for the HTTP API routes. + :param pulumi.Input[str] name: Name of the API. Must be less than or equal to 128 characters in length. + :param pulumi.Input[str] route_selection_expression: The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + Defaults to `$request.method $request.path`. + :param pulumi.Input[Mapping[str, pulumi.Input['HttpStageArgs']]] stages: The deployment stages for the HTTP API. + :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + :param pulumi.Input[str] version: Version identifier for the API. Must be between 1 and 64 characters in length. + """ + pulumi.set(__self__, "routes", routes) + if api_key_selection_expression is not None: + pulumi.set(__self__, "api_key_selection_expression", api_key_selection_expression) + if authorizers is not None: + pulumi.set(__self__, "authorizers", authorizers) + if body is not None: + pulumi.set(__self__, "body", body) + if cors_configuration is not None: + pulumi.set(__self__, "cors_configuration", cors_configuration) + if description is not None: + pulumi.set(__self__, "description", description) + if disable_execute_api_endpoint is not None: + pulumi.set(__self__, "disable_execute_api_endpoint", disable_execute_api_endpoint) + if domain_mappings is not None: + pulumi.set(__self__, "domain_mappings", domain_mappings) + if fail_on_warnings is not None: + pulumi.set(__self__, "fail_on_warnings", fail_on_warnings) + if integrations is not None: + pulumi.set(__self__, "integrations", integrations) + if name is not None: + pulumi.set(__self__, "name", name) + if route_selection_expression is not None: + pulumi.set(__self__, "route_selection_expression", route_selection_expression) + if stages is not None: + pulumi.set(__self__, "stages", stages) + if tags is not None: + pulumi.set(__self__, "tags", tags) + if version is not None: + pulumi.set(__self__, "version", version) + + @property + @pulumi.getter + def routes(self) -> pulumi.Input[Mapping[str, pulumi.Input['HttpRouteArgs']]]: + """ + The routes for the HTTP API. + """ + return pulumi.get(self, "routes") + + @routes.setter + def routes(self, value: pulumi.Input[Mapping[str, pulumi.Input['HttpRouteArgs']]]): + pulumi.set(self, "routes", value) + + @property + @pulumi.getter(name="apiKeySelectionExpression") + def api_key_selection_expression(self) -> Optional[pulumi.Input[str]]: + """ + An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + Applicable for WebSocket APIs. + """ + return pulumi.get(self, "api_key_selection_expression") + + @api_key_selection_expression.setter + def api_key_selection_expression(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "api_key_selection_expression", value) + + @property + @pulumi.getter + def authorizers(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input['HttpAuthorizerArgs']]]]: + """ + The authorizers for the HTTP API routes. + """ + return pulumi.get(self, "authorizers") + + @authorizers.setter + def authorizers(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input['HttpAuthorizerArgs']]]]): + pulumi.set(self, "authorizers", value) + + @property + @pulumi.getter + def body(self) -> Optional[pulumi.Input[str]]: + """ + An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + """ + return pulumi.get(self, "body") + + @body.setter + def body(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "body", value) + + @property + @pulumi.getter(name="corsConfiguration") + def cors_configuration(self) -> Optional[pulumi.Input['pulumi_aws.apigatewayv2.ApiCorsConfigurationArgs']]: + """ + Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + """ + return pulumi.get(self, "cors_configuration") + + @cors_configuration.setter + def cors_configuration(self, value: Optional[pulumi.Input['pulumi_aws.apigatewayv2.ApiCorsConfigurationArgs']]): + pulumi.set(self, "cors_configuration", value) + + @property + @pulumi.getter + def description(self) -> Optional[pulumi.Input[str]]: + """ + Description of the API. Must be less than or equal to 1024 characters in length. + """ + return pulumi.get(self, "description") + + @description.setter + def description(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "description", value) + + @property + @pulumi.getter(name="disableExecuteApiEndpoint") + def disable_execute_api_endpoint(self) -> Optional[pulumi.Input[bool]]: + """ + Whether clients can invoke the API by using the default `execute-api` endpoint. + By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + To require that clients use a custom domain name to invoke the API, disable the default endpoint. + """ + return pulumi.get(self, "disable_execute_api_endpoint") + + @disable_execute_api_endpoint.setter + def disable_execute_api_endpoint(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "disable_execute_api_endpoint", value) + + @property + @pulumi.getter(name="domainMappings") + def domain_mappings(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input['DomainMappingArgs']]]]: + """ + The domain names for the HTTP API. + """ + return pulumi.get(self, "domain_mappings") + + @domain_mappings.setter + def domain_mappings(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input['DomainMappingArgs']]]]): + pulumi.set(self, "domain_mappings", value) + + @property + @pulumi.getter(name="failOnWarnings") + def fail_on_warnings(self) -> Optional[pulumi.Input[bool]]: + """ + Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + """ + return pulumi.get(self, "fail_on_warnings") + + @fail_on_warnings.setter + def fail_on_warnings(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "fail_on_warnings", value) + + @property + @pulumi.getter + def integrations(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input['HttpIntegrationArgs']]]]: + """ + The integrations for the HTTP API routes. + """ + return pulumi.get(self, "integrations") + + @integrations.setter + def integrations(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input['HttpIntegrationArgs']]]]): + pulumi.set(self, "integrations", value) + + @property + @pulumi.getter + def name(self) -> Optional[pulumi.Input[str]]: + """ + Name of the API. Must be less than or equal to 128 characters in length. + """ + return pulumi.get(self, "name") + + @name.setter + def name(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "name", value) + + @property + @pulumi.getter(name="routeSelectionExpression") + def route_selection_expression(self) -> Optional[pulumi.Input[str]]: + """ + The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + Defaults to `$request.method $request.path`. + """ + return pulumi.get(self, "route_selection_expression") + + @route_selection_expression.setter + def route_selection_expression(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "route_selection_expression", value) + + @property + @pulumi.getter + def stages(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input['HttpStageArgs']]]]: + """ + The deployment stages for the HTTP API. + """ + return pulumi.get(self, "stages") + + @stages.setter + def stages(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input['HttpStageArgs']]]]): + pulumi.set(self, "stages", value) + + @property + @pulumi.getter + def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: + """ + Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + """ + return pulumi.get(self, "tags") + + @tags.setter + def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]): + pulumi.set(self, "tags", value) + + @property + @pulumi.getter + def version(self) -> Optional[pulumi.Input[str]]: + """ + Version identifier for the API. Must be between 1 and 64 characters in length. + """ + return pulumi.get(self, "version") + + @version.setter + def version(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "version", value) + + +class HttpApi(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + api_key_selection_expression: Optional[pulumi.Input[str]] = None, + authorizers: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpAuthorizerArgs']]]]] = None, + body: Optional[pulumi.Input[str]] = None, + cors_configuration: Optional[pulumi.Input[pulumi.InputType['pulumi_aws.apigatewayv2.ApiCorsConfigurationArgs']]] = None, + description: Optional[pulumi.Input[str]] = None, + disable_execute_api_endpoint: Optional[pulumi.Input[bool]] = None, + domain_mappings: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['DomainMappingArgs']]]]] = None, + fail_on_warnings: Optional[pulumi.Input[bool]] = None, + integrations: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpIntegrationArgs']]]]] = None, + name: Optional[pulumi.Input[str]] = None, + route_selection_expression: Optional[pulumi.Input[str]] = None, + routes: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpRouteArgs']]]]] = None, + stages: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpStageArgs']]]]] = None, + tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, + version: Optional[pulumi.Input[str]] = None, + __props__=None): + """ + Creates an HTTP API with associated sub-resources. + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] api_key_selection_expression: An [API key selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + Valid values: `$context.authorizer.usageIdentifierKey`, `$request.header.x-api-key`. Defaults to `$request.header.x-api-key`. + Applicable for WebSocket APIs. + :param pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpAuthorizerArgs']]]] authorizers: The authorizers for the HTTP API routes. + :param pulumi.Input[str] body: An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. + :param pulumi.Input[pulumi.InputType['pulumi_aws.apigatewayv2.ApiCorsConfigurationArgs']] cors_configuration: Cross-origin resource sharing (CORS) [configuration](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html). Applicable for HTTP APIs. + :param pulumi.Input[str] description: Description of the API. Must be less than or equal to 1024 characters in length. + :param pulumi.Input[bool] disable_execute_api_endpoint: Whether clients can invoke the API by using the default `execute-api` endpoint. + By default, clients can invoke the API with the default `{api_id}.execute-api.{region}.amazonaws.com endpoint`. + To require that clients use a custom domain name to invoke the API, disable the default endpoint. + :param pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['DomainMappingArgs']]]] domain_mappings: The domain names for the HTTP API. + :param pulumi.Input[bool] fail_on_warnings: Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to `false`. Applicable for HTTP APIs. + :param pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpIntegrationArgs']]]] integrations: The integrations for the HTTP API routes. + :param pulumi.Input[str] name: Name of the API. Must be less than or equal to 128 characters in length. + :param pulumi.Input[str] route_selection_expression: The [route selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-selection-expressions) for the API. + Defaults to `$request.method $request.path`. + :param pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpRouteArgs']]]] routes: The routes for the HTTP API. + :param pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpStageArgs']]]] stages: The deployment stages for the HTTP API. + :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Map of tags to assign to the API. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. + :param pulumi.Input[str] version: Version identifier for the API. Must be between 1 and 64 characters in length. + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: HttpApiArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + Creates an HTTP API with associated sub-resources. + + :param str resource_name: The name of the resource. + :param HttpApiArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(HttpApiArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + api_key_selection_expression: Optional[pulumi.Input[str]] = None, + authorizers: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpAuthorizerArgs']]]]] = None, + body: Optional[pulumi.Input[str]] = None, + cors_configuration: Optional[pulumi.Input[pulumi.InputType['pulumi_aws.apigatewayv2.ApiCorsConfigurationArgs']]] = None, + description: Optional[pulumi.Input[str]] = None, + disable_execute_api_endpoint: Optional[pulumi.Input[bool]] = None, + domain_mappings: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['DomainMappingArgs']]]]] = None, + fail_on_warnings: Optional[pulumi.Input[bool]] = None, + integrations: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpIntegrationArgs']]]]] = None, + name: Optional[pulumi.Input[str]] = None, + route_selection_expression: Optional[pulumi.Input[str]] = None, + routes: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpRouteArgs']]]]] = None, + stages: Optional[pulumi.Input[Mapping[str, pulumi.Input[pulumi.InputType['HttpStageArgs']]]]] = None, + tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, + version: Optional[pulumi.Input[str]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = HttpApiArgs.__new__(HttpApiArgs) + + __props__.__dict__["api_key_selection_expression"] = api_key_selection_expression + __props__.__dict__["authorizers"] = authorizers + __props__.__dict__["body"] = body + __props__.__dict__["cors_configuration"] = cors_configuration + __props__.__dict__["description"] = description + __props__.__dict__["disable_execute_api_endpoint"] = disable_execute_api_endpoint + __props__.__dict__["domain_mappings"] = domain_mappings + __props__.__dict__["fail_on_warnings"] = fail_on_warnings + __props__.__dict__["integrations"] = integrations + __props__.__dict__["name"] = name + __props__.__dict__["route_selection_expression"] = route_selection_expression + if routes is None and not opts.urn: + raise TypeError("Missing required property 'routes'") + __props__.__dict__["routes"] = routes + __props__.__dict__["stages"] = stages + __props__.__dict__["tags"] = tags + __props__.__dict__["version"] = version + __props__.__dict__["api"] = None + __props__.__dict__["api_mappings"] = None + __props__.__dict__["deployment"] = None + __props__.__dict__["domain_names"] = None + super(HttpApi, __self__).__init__( + 'awsx:apigatewayv2:HttpApi', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None) -> 'HttpApi': + """ + Get an existing HttpApi resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = HttpApiArgs.__new__(HttpApiArgs) + + __props__.__dict__["api"] = None + __props__.__dict__["api_mappings"] = None + __props__.__dict__["authorizers"] = None + __props__.__dict__["deployment"] = None + __props__.__dict__["domain_names"] = None + __props__.__dict__["integrations"] = None + __props__.__dict__["routes"] = None + __props__.__dict__["stages"] = None + return HttpApi(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter + def api(self) -> pulumi.Output['pulumi_aws.apigatewayv2.Api']: + """ + The underlying API resource. + """ + return pulumi.get(self, "api") + + @property + @pulumi.getter(name="apiMappings") + def api_mappings(self) -> pulumi.Output[Optional[Sequence['pulumi_aws.apigatewayv2.ApiMapping']]]: + """ + The API mappings for the HTTP API. + """ + return pulumi.get(self, "api_mappings") + + @property + @pulumi.getter + def authorizers(self) -> pulumi.Output[Sequence['pulumi_aws.apigatewayv2.Authorizer']]: + """ + The authorizers for the HTTP API routes. + """ + return pulumi.get(self, "authorizers") + + @property + @pulumi.getter + def deployment(self) -> pulumi.Output['pulumi_aws.apigatewayv2.Deployment']: + """ + The deployment for the HTTP API. + """ + return pulumi.get(self, "deployment") + + @property + @pulumi.getter(name="domainNames") + def domain_names(self) -> pulumi.Output[Sequence['pulumi_aws.apigatewayv2.DomainName']]: + """ + The domain names for the HTTP API. + """ + return pulumi.get(self, "domain_names") + + @property + @pulumi.getter + def integrations(self) -> pulumi.Output[Sequence['pulumi_aws.apigatewayv2.Integration']]: + """ + The integrations for the HTTP API routes. This is a map from integration name to the integration arguments. + """ + return pulumi.get(self, "integrations") + + @property + @pulumi.getter + def routes(self) -> pulumi.Output[Sequence['pulumi_aws.apigatewayv2.Route']]: + """ + The routes for the HTTP API. This is a map from route key (for example `GET /pets`) to route arguments. + """ + return pulumi.get(self, "routes") + + @property + @pulumi.getter + def stages(self) -> pulumi.Output[Sequence['pulumi_aws.apigatewayv2.Stage']]: + """ + The deployment stages for the HTTP API. + """ + return pulumi.get(self, "stages") +