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

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

Go to download

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

There is a newer version: 6.72.0
Show 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.CaCertificateArgs;
import com.pulumi.aws.iot.inputs.CaCertificateState;
import com.pulumi.aws.iot.outputs.CaCertificateRegistrationConfig;
import com.pulumi.aws.iot.outputs.CaCertificateValidity;
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.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Creates and manages an AWS IoT CA Certificate.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.tls.PrivateKey;
 * import com.pulumi.tls.PrivateKeyArgs;
 * import com.pulumi.tls.SelfSignedCert;
 * import com.pulumi.tls.SelfSignedCertArgs;
 * import com.pulumi.tls.inputs.SelfSignedCertSubjectArgs;
 * import com.pulumi.aws.iot.IotFunctions;
 * import com.pulumi.tls.CertRequest;
 * import com.pulumi.tls.CertRequestArgs;
 * import com.pulumi.tls.inputs.CertRequestSubjectArgs;
 * import com.pulumi.tls.LocallySignedCert;
 * import com.pulumi.tls.LocallySignedCertArgs;
 * import com.pulumi.aws.iot.CaCertificate;
 * import com.pulumi.aws.iot.CaCertificateArgs;
 * 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 caPrivateKey = new PrivateKey("caPrivateKey", PrivateKeyArgs.builder()
 *             .algorithm("RSA")
 *             .build());
 * 
 *         var ca = new SelfSignedCert("ca", SelfSignedCertArgs.builder()
 *             .privateKeyPem(caPrivateKey.privateKeyPem())
 *             .subject(SelfSignedCertSubjectArgs.builder()
 *                 .commonName("example.com")
 *                 .organization("ACME Examples, Inc")
 *                 .build())
 *             .validityPeriodHours(12)
 *             .allowedUses(            
 *                 "key_encipherment",
 *                 "digital_signature",
 *                 "server_auth")
 *             .isCaCertificate(true)
 *             .build());
 * 
 *         var verificationPrivateKey = new PrivateKey("verificationPrivateKey", PrivateKeyArgs.builder()
 *             .algorithm("RSA")
 *             .build());
 * 
 *         final var example = IotFunctions.getRegistrationCode();
 * 
 *         var verification = new CertRequest("verification", CertRequestArgs.builder()
 *             .privateKeyPem(verificationPrivateKey.privateKeyPem())
 *             .subject(CertRequestSubjectArgs.builder()
 *                 .commonName(example.applyValue(getRegistrationCodeResult -> getRegistrationCodeResult.registrationCode()))
 *                 .build())
 *             .build());
 * 
 *         var verificationLocallySignedCert = new LocallySignedCert("verificationLocallySignedCert", LocallySignedCertArgs.builder()
 *             .certRequestPem(verification.certRequestPem())
 *             .caPrivateKeyPem(caPrivateKey.privateKeyPem())
 *             .caCertPem(ca.certPem())
 *             .validityPeriodHours(12)
 *             .allowedUses(            
 *                 "key_encipherment",
 *                 "digital_signature",
 *                 "server_auth")
 *             .build());
 * 
 *         var exampleCaCertificate = new CaCertificate("exampleCaCertificate", CaCertificateArgs.builder()
 *             .active(true)
 *             .caCertificatePem(ca.certPem())
 *             .verificationCertificatePem(verificationLocallySignedCert.certPem())
 *             .allowAutoRegistration(true)
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * */ @ResourceType(type="aws:iot/caCertificate:CaCertificate") public class CaCertificate extends com.pulumi.resources.CustomResource { /** * Boolean flag to indicate if the certificate should be active for device authentication. * */ @Export(name="active", refs={Boolean.class}, tree="[0]") private Output active; /** * @return Boolean flag to indicate if the certificate should be active for device authentication. * */ public Output active() { return this.active; } /** * Boolean flag to indicate if the certificate should be active for device regisration. * */ @Export(name="allowAutoRegistration", refs={Boolean.class}, tree="[0]") private Output allowAutoRegistration; /** * @return Boolean flag to indicate if the certificate should be active for device regisration. * */ public Output allowAutoRegistration() { return this.allowAutoRegistration; } /** * The ARN of the created CA certificate. * */ @Export(name="arn", refs={String.class}, tree="[0]") private Output arn; /** * @return The ARN of the created CA certificate. * */ public Output arn() { return this.arn; } /** * PEM encoded CA certificate. * */ @Export(name="caCertificatePem", refs={String.class}, tree="[0]") private Output caCertificatePem; /** * @return PEM encoded CA certificate. * */ public Output caCertificatePem() { return this.caCertificatePem; } /** * The certificate mode in which the CA will be registered. Valida values: `DEFAULT` and `SNI_ONLY`. Default: `DEFAULT`. * */ @Export(name="certificateMode", refs={String.class}, tree="[0]") private Output certificateMode; /** * @return The certificate mode in which the CA will be registered. Valida values: `DEFAULT` and `SNI_ONLY`. Default: `DEFAULT`. * */ public Output> certificateMode() { return Codegen.optional(this.certificateMode); } /** * The customer version of the CA certificate. * */ @Export(name="customerVersion", refs={Integer.class}, tree="[0]") private Output customerVersion; /** * @return The customer version of the CA certificate. * */ public Output customerVersion() { return this.customerVersion; } /** * The generation ID of the CA certificate. * */ @Export(name="generationId", refs={String.class}, tree="[0]") private Output generationId; /** * @return The generation ID of the CA certificate. * */ public Output generationId() { return this.generationId; } /** * Information about the registration configuration. See below. * */ @Export(name="registrationConfig", refs={CaCertificateRegistrationConfig.class}, tree="[0]") private Output registrationConfig; /** * @return Information about the registration configuration. See below. * */ public Output> registrationConfig() { return Codegen.optional(this.registrationConfig); } /** * A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * * @deprecated * Please use `tags` instead. * */ @Deprecated /* Please use `tags` instead. */ @Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tagsAll; /** * @return A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * */ public Output> tagsAll() { return this.tagsAll; } /** * When the CA certificate is valid. * */ @Export(name="validities", refs={List.class,CaCertificateValidity.class}, tree="[0,1]") private Output> validities; /** * @return When the CA certificate is valid. * */ public Output> validities() { return this.validities; } /** * PEM encoded verification certificate containing the common name of a registration code. Review * [CreateVerificationCSR](https://docs.aws.amazon.com/iot/latest/developerguide/register-CA-cert.html). Reuired if `certificate_mode` is `DEFAULT`. * */ @Export(name="verificationCertificatePem", refs={String.class}, tree="[0]") private Output verificationCertificatePem; /** * @return PEM encoded verification certificate containing the common name of a registration code. Review * [CreateVerificationCSR](https://docs.aws.amazon.com/iot/latest/developerguide/register-CA-cert.html). Reuired if `certificate_mode` is `DEFAULT`. * */ public Output> verificationCertificatePem() { return Codegen.optional(this.verificationCertificatePem); } /** * * @param name The _unique_ name of the resulting resource. */ public CaCertificate(java.lang.String name) { this(name, CaCertificateArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public CaCertificate(java.lang.String name, CaCertificateArgs 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 CaCertificate(java.lang.String name, CaCertificateArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:iot/caCertificate:CaCertificate", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private CaCertificate(java.lang.String name, Output id, @Nullable CaCertificateState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:iot/caCertificate:CaCertificate", name, state, makeResourceOptions(options, id), false); } private static CaCertificateArgs makeArgs(CaCertificateArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? CaCertificateArgs.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()) .additionalSecretOutputs(List.of( "caCertificatePem", "verificationCertificatePem" )) .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 CaCertificate get(java.lang.String name, Output id, @Nullable CaCertificateState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new CaCertificate(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy