Skip to content

Commit

Permalink
Migrate certificate template to mmv1 (GoogleCloudPlatform#10527)
Browse files Browse the repository at this point in the history
  • Loading branch information
trodge authored May 22, 2024
1 parent 931670a commit 46c39dc
Show file tree
Hide file tree
Showing 10 changed files with 754 additions and 62 deletions.
272 changes: 264 additions & 8 deletions mmv1/products/privateca/CertificateTemplate.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mmv1/templates/terraform/datasource_iam.html.markdown.erb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The following arguments are supported:
<% url_properties.each do |param| -%>
<% if param.name == "name" -%>
* `<%= object.iam_policy.parent_resource_attribute || object.name.underscore -%>` - (Required) Used to find the parent resource to bind the IAM policy to
<% elsif ["region", "zone"].include?(param.name.underscore) -%>
<% elsif ["location", "region", "zone"].include?(param.name.underscore) -%>
* `<%= param.name.underscore -%>` - (Optional) <%= param.description -%> Used to find the parent resource to bind the IAM policy to. If not specified,
the value will be parsed from the identifier of the parent resource. If no <%= param.name.underscore -%> is provided in the parent identifier and no
<%= param.name.underscore -%> is specified, it is taken from the provider configuration.
Expand Down
56 changes: 56 additions & 0 deletions mmv1/templates/terraform/examples/privateca_template_basic.tf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
resource "google_privateca_certificate_template" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]["name"] %>"
location = "us-central1"
description = "A sample certificate template"

identity_constraints {
allow_subject_alt_names_passthrough = true
Expand All @@ -14,5 +15,60 @@ resource "google_privateca_certificate_template" "<%= ctx[:primary_resource_id]
title = "Sample expression"
}
}

maximum_lifetime = "86400s"

passthrough_extensions {
additional_extensions {
object_id_path = [1, 6]
}
known_extensions = ["EXTENDED_KEY_USAGE"]
}

predefined_values {
additional_extensions {
object_id {
object_id_path = [1, 6]
}
value = "c3RyaW5nCg=="
critical = true
}
aia_ocsp_servers = ["string"]
ca_options {
is_ca = false
max_issuer_path_length = 6
}
key_usage {
base_key_usage {
cert_sign = false
content_commitment = true
crl_sign = false
data_encipherment = true
decipher_only = true
digital_signature = true
encipher_only = true
key_agreement = true
key_encipherment = true
}
extended_key_usage {
client_auth = true
code_signing = true
email_protection = true
ocsp_signing = true
server_auth = true
time_stamping = true
}
unknown_extended_key_usages {
object_id_path = [1, 6]
}
}
policy_ids {
object_id_path = [1, 6]
}
}

labels = {
label-one = "value-one"
}
}
# [END privateca_create_certificate_template]
2 changes: 1 addition & 1 deletion mmv1/templates/terraform/resource_iam.html.markdown.erb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ The following arguments are supported:
<% url_properties.each do |param| -%>
<% if param.name == "name" -%>
* `<%= object.iam_policy.parent_resource_attribute || object.name.underscore -%>` - (Required) Used to find the parent resource to bind the IAM policy to
<% elsif ["region", "zone"].include?(param.name.underscore) -%>
<% elsif ["location", "region", "zone"].include?(param.name.underscore) -%>
* `<%= param.name.underscore -%>` - (Optional) <%= param.description -%> Used to find the parent resource to bind the IAM policy to. If not specified,
the value will be parsed from the identifier of the parent resource. If no <%= param.name.underscore -%> is provided in the parent identifier and no
<%= param.name.underscore -%> is specified, it is taken from the provider configuration.
Expand Down
Loading

0 comments on commit 46c39dc

Please sign in to comment.