Skip to content

googlePrivatecaCaPool

A CaPool represents a group of CertificateAuthorities that form a trust anchor. A CaPool can be used to manage issuance policies for one or more CertificateAuthority resources and to rotate CA certificates in and out of the trust anchor.

Example Usage - Privateca Capool Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.privatecaCaPool.PrivatecaCaPool(this, "default", {
  labels: [
    {
      foo: "bar",
    },
  ],
  location: "us-central1",
  name: "my-pool",
  publishing_options: [
    {
      publish_ca_cert: true,
      publish_crl: true,
    },
  ],
  tier: "ENTERPRISE",
});

Example Usage - Privateca Capool All Fields

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.privatecaCaPool.PrivatecaCaPool(this, "default", {
  issuance_policy: [
    {
      allowed_issuance_modes: [
        {
          allow_config_based_issuance: true,
          allow_csr_based_issuance: true,
        },
      ],
      allowed_key_types: [
        {
          elliptic_curve: [
            {
              signature_algorithm: "ECDSA_P256",
            },
          ],
        },
        {
          rsa: [
            {
              max_modulus_size: 10,
              min_modulus_size: 5,
            },
          ],
        },
      ],
      baseline_values: [
        {
          additional_extensions: [
            {
              critical: true,
              object_id: [
                {
                  object_id_path: [1, 7],
                },
              ],
              value: "asdf",
            },
          ],
          aia_ocsp_servers: ["example.com"],
          ca_options: [
            {
              is_ca: true,
              max_issuer_path_length: 10,
            },
          ],
          key_usage: [
            {
              base_key_usage: [
                {
                  cert_sign: false,
                  content_commitment: true,
                  crl_sign: true,
                  data_encipherment: true,
                  decipher_only: true,
                  digital_signature: true,
                  key_agreement: true,
                  key_encipherment: false,
                },
              ],
              extended_key_usage: [
                {
                  client_auth: false,
                  code_signing: true,
                  email_protection: true,
                  server_auth: true,
                  time_stamping: true,
                },
              ],
            },
          ],
          name_constraints: [
            {
              critical: true,
              excluded_dns_names: [
                "*.deny.example1.com",
                "*.deny.example2.com",
              ],
              excluded_email_addresses: [
                ".deny.example1.com",
                ".deny.example2.com",
              ],
              excluded_ip_ranges: ["10.1.1.0/24", "11.1.1.0/24"],
              excluded_uris: [".deny.example1.com", ".deny.example2.com"],
              permitted_dns_names: ["*.example1.com", "*.example2.com"],
              permitted_email_addresses: [".example1.com", ".example2.com"],
              permitted_ip_ranges: ["10.0.0.0/8", "11.0.0.0/8"],
              permitted_uris: [".example1.com", ".example2.com"],
            },
          ],
          policy_ids: [
            {
              object_id_path: [1, 5],
            },
            {
              object_id_path: [1, 5, 7],
            },
          ],
        },
      ],
      identity_constraints: [
        {
          allow_subject_alt_names_passthrough: true,
          allow_subject_passthrough: true,
          cel_expression: [
            {
              expression:
                "subject_alt_names.all(san, san.type == DNS || san.type == EMAIL )",
              title: "My title",
            },
          ],
        },
      ],
      maximum_lifetime: "50000s",
    },
  ],
  labels: [
    {
      foo: "bar",
    },
  ],
  location: "us-central1",
  name: "my-pool",
  publishing_options: [
    {
      publish_ca_cert: false,
      publish_crl: true,
    },
  ],
  tier: "ENTERPRISE",
});

Argument Reference

The following arguments are supported:

  • name - (Required) The name for this CaPool.

  • tier - (Required) The Tier of this CaPool. Possible values are enterprise and devops.

  • location - (Required) Location of the CaPool. A full list of valid locations can be found by running gcloudPrivatecaLocationsList.


  • issuancePolicy - (Optional) The IssuancePolicy to control how Certificates will be issued from this CaPool. Structure is documented below.

  • publishingOptions - (Optional) The PublishingOptions to follow when issuing Certificates from any CertificateAuthority in this CaPool. Structure is documented below.

  • labels - (Optional) Labels with user-defined metadata. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The issuancePolicy block supports:

  • allowedKeyTypes - (Optional) If any AllowedKeyType is specified, then the certificate request's public key must match one of the key types listed here. Otherwise, any key may be used. Structure is documented below.

  • maximumLifetime - (Optional) The maximum lifetime allowed for issued Certificates. Note that if the issuing CertificateAuthority expires before a Certificate's requested maximumLifetime, the effective lifetime will be explicitly truncated to match it.

  • allowedIssuanceModes - (Optional) IssuanceModes specifies the allowed ways in which Certificates may be requested from this CaPool. Structure is documented below.

  • identityConstraints - (Optional) Describes constraints on identities that may appear in Certificates issued through this CaPool. If this is omitted, then this CaPool will not add restrictions on a certificate's identity. Structure is documented below.

  • baselineValues - (Optional) A set of X.509 values that will be applied to all certificates issued through this CaPool. If a certificate request includes conflicting values for the same properties, they will be overwritten by the values defined here. If a certificate request uses a CertificateTemplate that defines conflicting predefinedValues for the same properties, the certificate issuance request will fail. Structure is documented below.

The allowedKeyTypes block supports:

  • rsa - (Optional) Describes an RSA key that may be used in a Certificate issued from a CaPool. Structure is documented below.

  • ellipticCurve - (Optional) Represents an allowed Elliptic Curve key type. Structure is documented below.

The rsa block supports:

  • minModulusSize - (Optional) The minimum allowed RSA modulus size, in bits. If this is not set, or if set to zero, the service-level min RSA modulus size will continue to apply.

  • maxModulusSize - (Optional) The maximum allowed RSA modulus size, in bits. If this is not set, or if set to zero, the service will not enforce an explicit upper bound on RSA modulus sizes.

The ellipticCurve block supports:

  • signatureAlgorithm - (Required) The algorithm used. Possible values are ecdsaP256, ecdsaP384, and eddsa25519.

The allowedIssuanceModes block supports:

  • allowCsrBasedIssuance - (Required) When true, allows callers to create Certificates by specifying a CSR.

  • allowConfigBasedIssuance - (Required) When true, allows callers to create Certificates by specifying a CertificateConfig.

The identityConstraints block supports:

  • allowSubjectPassthrough - (Required) If this is set, the Subject field may be copied from a certificate request into the signed certificate. Otherwise, the requested Subject will be discarded.

  • allowSubjectAltNamesPassthrough - (Required) If this is set, the SubjectAltNames extension may be copied from a certificate request into the signed certificate. Otherwise, the requested SubjectAltNames will be discarded.

  • celExpression - (Optional) A CEL expression that may be used to validate the resolved X.509 Subject and/or Subject Alternative Name before a certificate is signed. To see the full allowed syntax and some examples, see https://cloud.google.com/certificate-authority-service/docs/cel-guide Structure is documented below.

The celExpression block supports:

  • expression - (Required) Textual representation of an expression in Common Expression Language syntax.

  • title - (Optional) Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.

  • description - (Optional) Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

  • location - (Optional) String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.

The baselineValues block supports:

  • additionalExtensions - (Optional) Specifies an X.509 extension, which may be used in different parts of X.509 objects like certificates, CSRs, and CRLs. Structure is documented below.

  • policyIds - (Optional) Describes the X.509 certificate policy object identifiers, per https://tools.ietf.org/html/rfc5280#section-4.2.1.4. Structure is documented below.

  • aiaOcspServers - (Optional) Describes Online Certificate Status Protocol (OCSP) endpoint addresses that appear in the "Authority Information Access" extension in the certificate.

  • caOptions - (Required) Describes values that are relevant in a CA certificate. Structure is documented below.

  • keyUsage - (Required) Indicates the intended use for keys that correspond to a certificate. Structure is documented below.

  • nameConstraints - (Optional) Describes the X.509 name constraints extension. Structure is documented below.

The additionalExtensions block supports:

  • critical - (Required) Indicates whether or not this extension is critical (i.e., if the client does not know how to handle this extension, the client should consider this to be an error).

  • value - (Required) The value of this X.509 extension. A base64-encoded string.

  • objectId - (Required) Describes values that are relevant in a CA certificate. Structure is documented below.

The objectId block supports:

  • objectIdPath - (Required) An ObjectId specifies an object identifier (OID). These provide context and describe types in ASN.1 messages.

The policyIds block supports:

  • objectIdPath - (Required) An ObjectId specifies an object identifier (OID). These provide context and describe types in ASN.1 messages.

The caOptions block supports:

  • isCa - (Optional) When true, the "CA" in Basic Constraints extension will be set to true.

  • nonCa - (Optional) When true, the "CA" in Basic Constraints extension will be set to false. If both isCa and nonCa are unset, the extension will be omitted from the CA certificate.

  • maxIssuerPathLength - (Optional) Refers to the "path length constraint" in Basic Constraints extension. For a CA certificate, this value describes the depth of subordinate CA certificates that are allowed. If this value is less than 0, the request will fail.

  • zeroMaxIssuerPathLength - (Optional) When true, the "path length constraint" in Basic Constraints extension will be set to 0. if both maxIssuerPathLength and zeroMaxIssuerPathLength are unset, the max path length will be omitted from the CA certificate.

The keyUsage block supports:

  • baseKeyUsage - (Required) Describes high-level ways in which a key may be used. Structure is documented below.

  • extendedKeyUsage - (Required) Describes high-level ways in which a key may be used. Structure is documented below.

  • unknownExtendedKeyUsages - (Optional) An ObjectId specifies an object identifier (OID). These provide context and describe types in ASN.1 messages. Structure is documented below.

The baseKeyUsage block supports:

  • digitalSignature - (Optional) The key may be used for digital signatures.

  • contentCommitment - (Optional) The key may be used for cryptographic commitments. Note that this may also be referred to as "non-repudiation".

  • keyEncipherment - (Optional) The key may be used to encipher other keys.

  • dataEncipherment - (Optional) The key may be used to encipher data.

  • keyAgreement - (Optional) The key may be used in a key agreement protocol.

  • certSign - (Optional) The key may be used to sign certificates.

  • crlSign - (Optional) The key may be used sign certificate revocation lists.

  • encipherOnly - (Optional) The key may be used to encipher only.

  • decipherOnly - (Optional) The key may be used to decipher only.

The extendedKeyUsage block supports:

  • serverAuth - (Optional) Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW server authentication", though regularly used for non-WWW TLS.

  • clientAuth - (Optional) Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW client authentication", though regularly used for non-WWW TLS.

  • codeSigning - (Optional) Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of downloadable executable code client authentication".

  • emailProtection - (Optional) Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email protection".

  • timeStamping - (Optional) Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding the hash of an object to a time".

  • ocspSigning - (Optional) Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing OCSP responses".

The unknownExtendedKeyUsages block supports:

  • objectIdPath - (Required) An ObjectId specifies an object identifier (OID). These provide context and describe types in ASN.1 messages.

The nameConstraints block supports:

  • critical - (Required) Indicates whether or not the name constraints are marked critical.

  • permittedDnsNames - (Optional) Contains permitted DNS names. Any DNS name that can be constructed by simply adding zero or more labels to the left-hand side of the name satisfies the name constraint. For example, exampleCom, wwwExampleCom, wwwSubExampleCom would satisfy exampleCom while example1Com does not.

  • excludedDnsNames - (Optional) Contains excluded DNS names. Any DNS name that can be constructed by simply adding zero or more labels to the left-hand side of the name satisfies the name constraint. For example, exampleCom, wwwExampleCom, wwwSubExampleCom would satisfy exampleCom while example1Com does not.

  • permittedIpRanges - (Optional) Contains the permitted IP ranges. For IPv4 addresses, the ranges are expressed using CIDR notation as specified in RFC 4632. For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 addresses.

  • excludedIpRanges - (Optional) Contains the excluded IP ranges. For IPv4 addresses, the ranges are expressed using CIDR notation as specified in RFC 4632. For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 addresses.

  • permittedEmailAddresses - (Optional) Contains the permitted email addresses. The value can be a particular email address, a hostname to indicate all email addresses on that host or a domain with a leading period (e.g. exampleCom) to indicate all email addresses in that domain.

  • excludedEmailAddresses - (Optional) Contains the excluded email addresses. The value can be a particular email address, a hostname to indicate all email addresses on that host or a domain with a leading period (e.g. exampleCom) to indicate all email addresses in that domain.

  • permittedUris - (Optional) Contains the permitted URIs that apply to the host part of the name. The value can be a hostname or a domain with a leading period (like exampleCom)

  • excludedUris - (Optional) Contains the excluded URIs that apply to the host part of the name. The value can be a hostname or a domain with a leading period (like exampleCom)

The publishingOptions block supports:

  • publishCaCert - (Required) When true, publishes each CertificateAuthority's CA certificate and includes its URL in the "Authority Information Access" X.509 extension in all issued Certificates. If this is false, the CA certificate will not be published and the corresponding X.509 extension will not be written in issued certificates.

  • publishCrl - (Required) When true, publishes each CertificateAuthority's CRL and includes its URL in the "CRL Distribution Points" X.509 extension in all issued Certificates. If this is false, CRLs will not be published and the corresponding X.509 extension will not be written in issued certificates. CRLs will expire 7 days from their creation. However, we will rebuild daily. CRLs are also rebuilt shortly after a certificate is revoked.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/caPools/{{name}}

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

CaPool can be imported using any of these accepted formats:

$ terraform import google_privateca_ca_pool.default projects/{{project}}/locations/{{location}}/caPools/{{name}}
$ terraform import google_privateca_ca_pool.default {{project}}/{{location}}/{{name}}
$ terraform import google_privateca_ca_pool.default {{location}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.