Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion mmv1/products/privateca/Certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ samples:
ca_pool_id: my-pool
test_env_vars:
project: PROJECT_NAME
- name: privateca_certificate_subject_config_org_optional
primary_resource_id: default
steps:
- name: privateca_certificate_subject_config_org_optional
resource_id_vars:
certificate_name: my-certificate
ca_pool_id: my-pool
test_env_vars:
project: PROJECT_NAME
parameters:
- name: location
type: String
Expand Down Expand Up @@ -1026,7 +1035,6 @@ properties:
- name: organization
type: String
description: The organization of the subject.
required: true
immutable: true
- name: organizationalUnit
type: String
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
resource "google_privateca_ca_pool" "default" {
location = "us-central1"
name = "{{index $.ResourceIdVars "ca_pool_id"}}"
tier = "ENTERPRISE"
}

resource "google_privateca_certificate_authority" "default" {
location = "us-central1"
pool = google_privateca_ca_pool.default.name
certificate_authority_id = "my-authority"
config {
subject_config {
subject {
common_name = "my-certificate-authority"
}
subject_alt_name {
dns_names = ["hashicorp.com"]
}
}
x509_config {
ca_options {
is_ca = true
}
key_usage {
base_key_usage {
digital_signature = true
cert_sign = true
crl_sign = true
}
extended_key_usage {
server_auth = true
}
}
}
}
lifetime = "86400s"
key_spec {
algorithm = "RSA_PKCS1_4096_SHA256"
}

// Disable CA deletion related safe checks for easier cleanup.
deletion_protection = false
skip_grace_period = true
ignore_active_certificates_on_deletion = true
}


resource "google_privateca_certificate" "{{$.PrimaryResourceId}}" {
location = "us-central1"
pool = google_privateca_ca_pool.default.name
name = "{{index $.ResourceIdVars "certificate_name"}}"
lifetime = "860s"
config {
subject_config {
subject {
common_name = "san1.example.com"
}
}
x509_config {
ca_options {
is_ca = false
}
key_usage {
base_key_usage {
crl_sign = true
}
extended_key_usage {
server_auth = true
}
}
}
public_key {
format = "PEM"
key = filebase64("test-fixtures/rsa_public.pem")
}
}
// Certificates require an authority to exist in the pool, though they don't
// need to be explicitly connected to it
depends_on = [google_privateca_certificate_authority.default]
}
Loading