com.pulumi.aws.apigatewayv2.ApiMapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws Show documentation
Show all versions of aws Show documentation
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
// *** 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.aws.apigatewayv2;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.apigatewayv2.ApiMappingArgs;
import com.pulumi.aws.apigatewayv2.inputs.ApiMappingState;
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.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages an Amazon API Gateway Version 2 API mapping.
* More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html).
*
* ## Example Usage
*
* ### Basic
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.apigatewayv2.ApiMapping;
* import com.pulumi.aws.apigatewayv2.ApiMappingArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var example = new ApiMapping("example", ApiMappingArgs.builder()
* .apiId(exampleAwsApigatewayv2Api.id())
* .domainName(exampleAwsApigatewayv2DomainName.id())
* .stage(exampleAwsApigatewayv2Stage.id())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example:
*
* ```sh
* $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com
* ```
*
*/
@ResourceType(type="aws:apigatewayv2/apiMapping:ApiMapping")
public class ApiMapping extends com.pulumi.resources.CustomResource {
/**
* API identifier.
*
*/
@Export(name="apiId", refs={String.class}, tree="[0]")
private Output apiId;
/**
* @return API identifier.
*
*/
public Output apiId() {
return this.apiId;
}
/**
* The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html).
*
*/
@Export(name="apiMappingKey", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> apiMappingKey;
/**
* @return The API mapping key. Refer to [REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html), [HTTP API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-mappings.html) or [WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-mappings.html).
*
*/
public Output> apiMappingKey() {
return Codegen.optional(this.apiMappingKey);
}
/**
* Domain name. Use the `aws.apigatewayv2.DomainName` resource to configure a domain name.
*
*/
@Export(name="domainName", refs={String.class}, tree="[0]")
private Output domainName;
/**
* @return Domain name. Use the `aws.apigatewayv2.DomainName` resource to configure a domain name.
*
*/
public Output domainName() {
return this.domainName;
}
/**
* API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage.
*
*/
@Export(name="stage", refs={String.class}, tree="[0]")
private Output stage;
/**
* @return API stage. Use the `aws.apigatewayv2.Stage` resource to configure an API stage.
*
*/
public Output stage() {
return this.stage;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ApiMapping(java.lang.String name) {
this(name, ApiMappingArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ApiMapping(java.lang.String name, ApiMappingArgs 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 ApiMapping(java.lang.String name, ApiMappingArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:apigatewayv2/apiMapping:ApiMapping", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ApiMapping(java.lang.String name, Output id, @Nullable ApiMappingState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:apigatewayv2/apiMapping:ApiMapping", name, state, makeResourceOptions(options, id), false);
}
private static ApiMappingArgs makeArgs(ApiMappingArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ApiMappingArgs.Empty : args;
}
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 state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static ApiMapping get(java.lang.String name, Output id, @Nullable ApiMappingState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ApiMapping(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy