
com.pulumi.aws.lightsail.StaticIpAttachment 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.lightsail;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.lightsail.StaticIpAttachmentArgs;
import com.pulumi.aws.lightsail.inputs.StaticIpAttachmentState;
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 javax.annotation.Nullable;
/**
* Provides a static IP address attachment - relationship between a Lightsail static IP & Lightsail instance.
*
* > **Note:** Lightsail is currently only supported in a limited number of AWS Regions, please see ["Regions and Availability Zones in Amazon Lightsail"](https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail) for more details
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.lightsail.StaticIp;
* import com.pulumi.aws.lightsail.StaticIpArgs;
* import com.pulumi.aws.lightsail.Instance;
* import com.pulumi.aws.lightsail.InstanceArgs;
* import com.pulumi.aws.lightsail.StaticIpAttachment;
* import com.pulumi.aws.lightsail.StaticIpAttachmentArgs;
* 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 testStaticIp = new StaticIp("testStaticIp", StaticIpArgs.builder()
* .name("example")
* .build());
*
* var testInstance = new Instance("testInstance", InstanceArgs.builder()
* .name("example")
* .availabilityZone("us-east-1b")
* .blueprintId("string")
* .bundleId("string")
* .keyPairName("some_key_name")
* .build());
*
* var test = new StaticIpAttachment("test", StaticIpAttachmentArgs.builder()
* .staticIpName(testStaticIp.id())
* .instanceName(testInstance.id())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
@ResourceType(type="aws:lightsail/staticIpAttachment:StaticIpAttachment")
public class StaticIpAttachment extends com.pulumi.resources.CustomResource {
/**
* The name of the Lightsail instance to attach the IP to
*
*/
@Export(name="instanceName", refs={String.class}, tree="[0]")
private Output instanceName;
/**
* @return The name of the Lightsail instance to attach the IP to
*
*/
public Output instanceName() {
return this.instanceName;
}
/**
* The allocated static IP address
*
*/
@Export(name="ipAddress", refs={String.class}, tree="[0]")
private Output ipAddress;
/**
* @return The allocated static IP address
*
*/
public Output ipAddress() {
return this.ipAddress;
}
/**
* The name of the allocated static IP
*
*/
@Export(name="staticIpName", refs={String.class}, tree="[0]")
private Output staticIpName;
/**
* @return The name of the allocated static IP
*
*/
public Output staticIpName() {
return this.staticIpName;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public StaticIpAttachment(java.lang.String name) {
this(name, StaticIpAttachmentArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public StaticIpAttachment(java.lang.String name, StaticIpAttachmentArgs 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 StaticIpAttachment(java.lang.String name, StaticIpAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:lightsail/staticIpAttachment:StaticIpAttachment", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private StaticIpAttachment(java.lang.String name, Output id, @Nullable StaticIpAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:lightsail/staticIpAttachment:StaticIpAttachment", name, state, makeResourceOptions(options, id), false);
}
private static StaticIpAttachmentArgs makeArgs(StaticIpAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? StaticIpAttachmentArgs.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 StaticIpAttachment get(java.lang.String name, Output id, @Nullable StaticIpAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new StaticIpAttachment(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy