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

com.pulumi.okta.DomainCertificate Maven / Gradle / Ivy

// *** 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.okta;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.okta.DomainCertificateArgs;
import com.pulumi.okta.Utilities;
import com.pulumi.okta.inputs.DomainCertificateState;
import java.lang.String;
import javax.annotation.Nullable;

/**
 * Manages certificate for the domain.
 * This resource's 'certificate', 'private_key', and 'certificate_chain' attributes
 * hold actual PEM values and can be referred to by other configs requiring
 * certificate and private key inputs. This is inline with TF's best
 * practices
 * of not encrypting state.
 * See Let's Encrypt Certbot notes at the end of this
 * documentation for notes on how to generate a domain certificate with Let's Encrypt Certbot
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.okta.Domain;
 * import com.pulumi.okta.DomainArgs;
 * import com.pulumi.okta.DomainCertificate;
 * import com.pulumi.okta.DomainCertificateArgs;
 * 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 Domain("example", DomainArgs.builder()
 *             .name("www.example.com")
 *             .build());
 * 
 *         var test = new DomainCertificate("test", DomainCertificateArgs.builder()
 *             .domainId(testOktaDomain.id())
 *             .type("PEM")
 *             .certificate("""
 * -----BEGIN CERTIFICATE-----
 * MIIFNzCCBB+gAwIBAgISBAXomJWRama3ypu8TIxdA9wzMA0GCSqGSIb3DQEBCwUA
 * ...
 * NSgRtSXq11j8O4JONi8EXe7cEtvzUiLR5PL3itsK2svtrZ9jIwQ95wOPaA==
 * -----END CERTIFICATE-----
 *             """)
 *             .certificateChain("""
 * -----BEGIN CERTIFICATE-----
 * MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
 * ...
 * Dfvp7OOGAN6dEOM4+qR9sdjoSYKEBpsr6GtPAQw4dy753ec5
 * -----END CERTIFICATE-----
 *             """)
 *             .privateKey("""
 * -----BEGIN PRIVATE KEY-----
 * MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC5cyk6x63iBJSW
 * ...
 * nUFLNE8pXSnsqb0eOL74f3uQ
 * -----END PRIVATE KEY-----
 *             """)
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Let's Encrypt Certbot * * This example demonstrates generatoring a domain certificate with letsencrypt * certbot https://letsencrypt.org/getting-started/ * * Use letsencrypt's certbot to generate domain certificates in RSA output mode. * The generator's output corresponds to `okta.DomainCertificate` fields in the * following manner. * * Okta Field | Certbot file * --------------------|-------------- * `certificate` | `cert.pem` * `certificate_chain` | `chain.pem` * `private_key` | `privkey.pem` * */ @ResourceType(type="okta:index/domainCertificate:DomainCertificate") public class DomainCertificate extends com.pulumi.resources.CustomResource { /** * Certificate content * */ @Export(name="certificate", refs={String.class}, tree="[0]") private Output certificate; /** * @return Certificate content * */ public Output certificate() { return this.certificate; } /** * Certificate chain * */ @Export(name="certificateChain", refs={String.class}, tree="[0]") private Output certificateChain; /** * @return Certificate chain * */ public Output certificateChain() { return this.certificateChain; } /** * Domain's ID * */ @Export(name="domainId", refs={String.class}, tree="[0]") private Output domainId; /** * @return Domain's ID * */ public Output domainId() { return this.domainId; } /** * Certificate private key * */ @Export(name="privateKey", refs={String.class}, tree="[0]") private Output privateKey; /** * @return Certificate private key * */ public Output privateKey() { return this.privateKey; } /** * Certificate type. Valid value is `PEM` * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Certificate type. Valid value is `PEM` * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public DomainCertificate(java.lang.String name) { this(name, DomainCertificateArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public DomainCertificate(java.lang.String name, DomainCertificateArgs 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 DomainCertificate(java.lang.String name, DomainCertificateArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("okta:index/domainCertificate:DomainCertificate", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private DomainCertificate(java.lang.String name, Output id, @Nullable DomainCertificateState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("okta:index/domainCertificate:DomainCertificate", name, state, makeResourceOptions(options, id), false); } private static DomainCertificateArgs makeArgs(DomainCertificateArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? DomainCertificateArgs.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 DomainCertificate get(java.lang.String name, Output id, @Nullable DomainCertificateState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new DomainCertificate(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy