Skip to content

Commit

Permalink
fixed diff in publishing_options
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardmedia committed Aug 26, 2021
1 parent 4e4b6af commit 036b43e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mmv1/products/privateca/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1517,13 +1517,15 @@ objects:
- !ruby/object:Api::Type::Boolean
name: 'publishCaCert'
required: true
send_empty_value: true
description: |
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.
- !ruby/object:Api::Type::Boolean
name: 'publishCrl'
required: true
send_empty_value: true
description: |
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
Expand Down
2 changes: 2 additions & 0 deletions mmv1/products/privateca/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
custom_flatten: 'templates/terraform/custom_flatten/privateca_certificate_509_config.go.erb'
issuancePolicy.baselineValues.caOptions.maxIssuerPathLength: !ruby/object:Overrides::Terraform::PropertyOverride
send_empty_value: true
publishingOptions: !ruby/object:Overrides::Terraform::PropertyOverride
diff_suppress_func: 'emptyOrUnsetBlockDiffSuppress'
iam_policy: !ruby/object:Api::Resource::IamPolicy
allowed_iam_role: 'roles/privateca.certificateManager'
method_name_separator: ':'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,45 @@ resource "google_privateca_ca_pool" "default" {
}
`, context)
}

func TestAccPrivatecaCaPool_privatecaCapoolEmptyPublishingOptions(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": randString(t, 10),
}

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckPrivatecaCaPoolDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccPrivatecaCaPool_privatecaCapoolEmptyPublishingOptions(context),
},
{
ResourceName: "google_privateca_ca_pool.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name", "location"},
},
},
})
}

func testAccPrivatecaCaPool_privatecaCapoolEmptyPublishingOptions(context map[string]interface{}) string {
return Nprintf(`
resource "google_privateca_ca_pool" "default" {
name = "tf-test-my-capool%{random_suffix}"
location = "us-central1"
tier = "ENTERPRISE"
publishing_options {
publish_ca_cert = false
publish_crl = false
}
labels = {
foo = "bar"
}
}
`, context)
}

0 comments on commit 036b43e

Please sign in to comment.