All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.iot.ThingPrincipalAttachment Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

The newest version!
// *** 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.iot;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.iot.ThingPrincipalAttachmentArgs;
import com.pulumi.aws.iot.inputs.ThingPrincipalAttachmentState;
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;

/**
 * Attaches Principal to AWS IoT Thing.
 * 
 * ## 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.iot.Thing;
 * import com.pulumi.aws.iot.ThingArgs;
 * import com.pulumi.aws.iot.Certificate;
 * import com.pulumi.aws.iot.CertificateArgs;
 * import com.pulumi.aws.iot.ThingPrincipalAttachment;
 * import com.pulumi.aws.iot.ThingPrincipalAttachmentArgs;
 * 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 Thing("example", ThingArgs.builder()
 *             .name("example")
 *             .build());
 * 
 *         var cert = new Certificate("cert", CertificateArgs.builder()
 *             .csr(StdFunctions.file(FileArgs.builder()
 *                 .input("csr.pem")
 *                 .build()).result())
 *             .active(true)
 *             .build());
 * 
 *         var att = new ThingPrincipalAttachment("att", ThingPrincipalAttachmentArgs.builder()
 *             .principal(cert.arn())
 *             .thing(example.name())
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * */ @ResourceType(type="aws:iot/thingPrincipalAttachment:ThingPrincipalAttachment") public class ThingPrincipalAttachment extends com.pulumi.resources.CustomResource { /** * The AWS IoT Certificate ARN or Amazon Cognito Identity ID. * */ @Export(name="principal", refs={String.class}, tree="[0]") private Output principal; /** * @return The AWS IoT Certificate ARN or Amazon Cognito Identity ID. * */ public Output principal() { return this.principal; } /** * The name of the thing. * */ @Export(name="thing", refs={String.class}, tree="[0]") private Output thing; /** * @return The name of the thing. * */ public Output thing() { return this.thing; } /** * * @param name The _unique_ name of the resulting resource. */ public ThingPrincipalAttachment(java.lang.String name) { this(name, ThingPrincipalAttachmentArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ThingPrincipalAttachment(java.lang.String name, ThingPrincipalAttachmentArgs 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 ThingPrincipalAttachment(java.lang.String name, ThingPrincipalAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:iot/thingPrincipalAttachment:ThingPrincipalAttachment", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ThingPrincipalAttachment(java.lang.String name, Output id, @Nullable ThingPrincipalAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:iot/thingPrincipalAttachment:ThingPrincipalAttachment", name, state, makeResourceOptions(options, id), false); } private static ThingPrincipalAttachmentArgs makeArgs(ThingPrincipalAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ThingPrincipalAttachmentArgs.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 ThingPrincipalAttachment get(java.lang.String name, Output id, @Nullable ThingPrincipalAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ThingPrincipalAttachment(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy