com.pulumi.vault.pkiSecret.kotlin.SecretBackendRootCert.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-vault-kotlin Show documentation
Show all versions of pulumi-vault-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.vault.pkiSecret.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [SecretBackendRootCert].
*/
@PulumiTagMarker
public class SecretBackendRootCertResourceBuilder internal constructor() {
public var name: String? = null
public var args: SecretBackendRootCertArgs = SecretBackendRootCertArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend SecretBackendRootCertArgsBuilder.() -> Unit) {
val builder = SecretBackendRootCertArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): SecretBackendRootCert {
val builtJavaResource =
com.pulumi.vault.pkiSecret.SecretBackendRootCert(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SecretBackendRootCert(builtJavaResource)
}
}
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const test = new vault.pkisecret.SecretBackendRootCert("test", {
* backend: pki.path,
* type: "internal",
* commonName: "Root CA",
* ttl: "315360000",
* format: "pem",
* privateKeyFormat: "der",
* keyType: "rsa",
* keyBits: 4096,
* excludeCnFromSans: true,
* ou: "My OU",
* organization: "My organization",
* }, {
* dependsOn: [pki],
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* test = vault.pki_secret.SecretBackendRootCert("test",
* backend=pki["path"],
* type="internal",
* common_name="Root CA",
* ttl="315360000",
* format="pem",
* private_key_format="der",
* key_type="rsa",
* key_bits=4096,
* exclude_cn_from_sans=True,
* ou="My OU",
* organization="My organization",
* opts = pulumi.ResourceOptions(depends_on=[pki]))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var test = new Vault.PkiSecret.SecretBackendRootCert("test", new()
* {
* Backend = pki.Path,
* Type = "internal",
* CommonName = "Root CA",
* Ttl = "315360000",
* Format = "pem",
* PrivateKeyFormat = "der",
* KeyType = "rsa",
* KeyBits = 4096,
* ExcludeCnFromSans = true,
* Ou = "My OU",
* Organization = "My organization",
* }, new CustomResourceOptions
* {
* DependsOn =
* {
* pki,
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault/pkiSecret"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := pkiSecret.NewSecretBackendRootCert(ctx, "test", &pkiSecret.SecretBackendRootCertArgs{
* Backend: pulumi.Any(pki.Path),
* Type: pulumi.String("internal"),
* CommonName: pulumi.String("Root CA"),
* Ttl: pulumi.String("315360000"),
* Format: pulumi.String("pem"),
* PrivateKeyFormat: pulumi.String("der"),
* KeyType: pulumi.String("rsa"),
* KeyBits: pulumi.Int(4096),
* ExcludeCnFromSans: pulumi.Bool(true),
* Ou: pulumi.String("My OU"),
* Organization: pulumi.String("My organization"),
* }, pulumi.DependsOn([]pulumi.Resource{
* pki,
* }))
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.vault.pkiSecret.SecretBackendRootCert;
* import com.pulumi.vault.pkiSecret.SecretBackendRootCertArgs;
* import com.pulumi.resources.CustomResourceOptions;
* 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 test = new SecretBackendRootCert("test", SecretBackendRootCertArgs.builder()
* .backend(pki.path())
* .type("internal")
* .commonName("Root CA")
* .ttl("315360000")
* .format("pem")
* .privateKeyFormat("der")
* .keyType("rsa")
* .keyBits(4096)
* .excludeCnFromSans(true)
* .ou("My OU")
* .organization("My organization")
* .build(), CustomResourceOptions.builder()
* .dependsOn(pki)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: vault:pkiSecret:SecretBackendRootCert
* properties:
* backend: ${pki.path}
* type: internal
* commonName: Root CA
* ttl: '315360000'
* format: pem
* privateKeyFormat: der
* keyType: rsa
* keyBits: 4096
* excludeCnFromSans: true
* ou: My OU
* organization: My organization
* options:
* dependson:
* - ${pki}
* ```
*
*/
public class SecretBackendRootCert internal constructor(
override val javaResource: com.pulumi.vault.pkiSecret.SecretBackendRootCert,
) : KotlinCustomResource(javaResource, SecretBackendRootCertMapper) {
/**
* List of alternative names
*/
public val altNames: Output>?
get() = javaResource.altNames().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* The PKI secret backend the resource belongs to.
*/
public val backend: Output
get() = javaResource.backend().applyValue({ args0 -> args0 })
/**
* The certificate.
*/
public val certificate: Output
get() = javaResource.certificate().applyValue({ args0 -> args0 })
/**
* CN of intermediate to create
*/
public val commonName: Output
get() = javaResource.commonName().applyValue({ args0 -> args0 })
/**
* The country
*/
public val country: Output?
get() = javaResource.country().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Flag to exclude CN from SANs
*/
public val excludeCnFromSans: Output?
get() = javaResource.excludeCnFromSans().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The format of data
*/
public val format: Output?
get() = javaResource.format().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* List of alternative IPs
*/
public val ipSans: Output>?
get() = javaResource.ipSans().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* The ID of the generated issuer.
*/
public val issuerId: Output
get() = javaResource.issuerId().applyValue({ args0 -> args0 })
/**
* Provides a name to the specified issuer. The name must be unique
* across all issuers and not be the reserved value `default`
*/
public val issuerName: Output
get() = javaResource.issuerName().applyValue({ args0 -> args0 })
/**
* The issuing CA certificate.
*/
public val issuingCa: Output
get() = javaResource.issuingCa().applyValue({ args0 -> args0 })
/**
* The number of bits to use
*/
public val keyBits: Output?
get() = javaResource.keyBits().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The ID of the generated key.
*/
public val keyId: Output
get() = javaResource.keyId().applyValue({ args0 -> args0 })
/**
* When a new key is created with this request, optionally specifies
* the name for this. The global ref `default` may not be used as a name.
*/
public val keyName: Output
get() = javaResource.keyName().applyValue({ args0 -> args0 })
/**
* Specifies the key (either default, by name, or by identifier) to use
* for generating this request. Only suitable for `type=existing` requests.
*/
public val keyRef: Output
get() = javaResource.keyRef().applyValue({ args0 -> args0 })
/**
* The desired key type
*/
public val keyType: Output?
get() = javaResource.keyType().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The locality
*/
public val locality: Output?
get() = javaResource.locality().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The ID of the previously configured managed key. This field is
* required if `type` is `kms` and it conflicts with `managed_key_name`
*/
public val managedKeyId: Output
get() = javaResource.managedKeyId().applyValue({ args0 -> args0 })
/**
* The name of the previously configured managed key. This field is
* required if `type` is `kms` and it conflicts with `managed_key_id`
*/
public val managedKeyName: Output
get() = javaResource.managedKeyName().applyValue({ args0 -> args0 })
/**
* The maximum path length to encode in the generated certificate
*/
public val maxPathLength: Output?
get() = javaResource.maxPathLength().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
* *Available only for Vault Enterprise*.
*/
public val namespace: Output?
get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The organization
*/
public val organization: Output?
get() = javaResource.organization().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* List of other SANs
*/
public val otherSans: Output>?
get() = javaResource.otherSans().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* The organization unit
*/
public val ou: Output?
get() = javaResource.ou().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* List of domains for which certificates are allowed to be issued
*/
public val permittedDnsDomains: Output>?
get() = javaResource.permittedDnsDomains().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* The postal code
*/
public val postalCode: Output?
get() = javaResource.postalCode().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The private key format
*/
public val privateKeyFormat: Output?
get() = javaResource.privateKeyFormat().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The province
*/
public val province: Output?
get() = javaResource.province().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The certificate's serial number, hex formatted.
*/
public val serialNumber: Output
get() = javaResource.serialNumber().applyValue({ args0 -> args0 })
/**
* The street address
*/
public val streetAddress: Output?
get() = javaResource.streetAddress().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Time to live
*/
public val ttl: Output?
get() = javaResource.ttl().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Type of intermediate to create. Must be either \"exported\", \"internal\"
* or \"kms\"
*/
public val type: Output
get() = javaResource.type().applyValue({ args0 -> args0 })
/**
* List of alternative URIs
*/
public val uriSans: Output>?
get() = javaResource.uriSans().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
}
public object SecretBackendRootCertMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.vault.pkiSecret.SecretBackendRootCert::class == javaResource::class
override fun map(javaResource: Resource): SecretBackendRootCert =
SecretBackendRootCert(javaResource as com.pulumi.vault.pkiSecret.SecretBackendRootCert)
}
/**
* @see [SecretBackendRootCert].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [SecretBackendRootCert].
*/
public suspend fun secretBackendRootCert(
name: String,
block: suspend SecretBackendRootCertResourceBuilder.() -> Unit,
): SecretBackendRootCert {
val builder = SecretBackendRootCertResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [SecretBackendRootCert].
* @param name The _unique_ name of the resulting resource.
*/
public fun secretBackendRootCert(name: String): SecretBackendRootCert {
val builder = SecretBackendRootCertResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy