6060 }
6161 gatewayCaBundlesRepresentation = map [string ]interface {}{
6262 "type" : acctest.Representation {RepType : acctest .Required , Create : `CA_BUNDLE` , Update : `CERTIFICATE_AUTHORITY` },
63- "ca_bundle_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.ca_bundle_id} ` },
64- "certificate_authority_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.certificate_authority_id }` },
63+ "ca_bundle_id" : acctest.Representation {RepType : acctest .Optional , Create : `${oci_certificates_management_ca_bundle.test_ca_bundle.id}` , Update : ` ` },
64+ "certificate_authority_id" : acctest.Representation {RepType : acctest .Optional , Update : `${oci_certificates_management_certificate_authority.test_certificate_authority.id }` },
6565 }
6666 gatewayResponseCacheDetailsRepresentation = map [string ]interface {}{
6767 "type" : acctest.Representation {RepType : acctest .Required , Create : `EXTERNAL_RESP_CACHE` },
8484 acctest .GenerateResourceFromRepresentationMap ("oci_core_network_security_group" , "test_network_security_group2" , acctest .Required , acctest .Create , networkSecurityGroupRepresentation ) +
8585 acctest .GenerateResourceFromRepresentationMap ("oci_core_subnet" , "test_subnet" , acctest .Required , acctest .Create , subnetRepresentation ) +
8686 acctest .GenerateResourceFromRepresentationMap ("oci_core_vcn" , "test_vcn" , acctest .Required , acctest .Create , vcnRepresentation ) +
87+ acctest .GenerateResourceFromRepresentationMap ("oci_certificates_management_ca_bundle" , "test_ca_bundle" , acctest .Required , acctest .Create , caBundleRepresentationRequired ) +
88+ acctest .GenerateResourceFromRepresentationMap ("oci_certificates_management_certificate_authority" , "test_certificate_authority" , acctest .Required , acctest .Create , certificateAuthorityRepresentationRoot ) +
8789 DefinedTagsDependencies +
8890 apiCertificateVariableStr + apiPrivateKeyVariableStr
8991)
@@ -101,12 +103,6 @@ func TestApigatewayGatewayResource_basic(t *testing.T) {
101103 compartmentIdU := utils .GetEnvSettingWithDefault ("compartment_id_for_update" , compartmentId )
102104 compartmentIdUVariableStr := fmt .Sprintf ("variable \" compartment_id_for_update\" { default = \" %s\" }\n " , compartmentIdU )
103105
104- caBundleId := utils .GetEnvSettingWithBlankDefault ("ca_bundle_id" )
105- caBundleIdVariableStr := fmt .Sprintf ("variable \" ca_bundle_id\" { default = \" %s\" }\n " , caBundleId )
106-
107- certificateAuthorityId := utils .GetEnvSettingWithBlankDefault ("certificate_authority_id" )
108- certificateAuthorityIdVariableStr := fmt .Sprintf ("variable \" certificate_authority_id\" { default = \" %s\" }\n " , certificateAuthorityId )
109-
110106 vaultSecretId := utils .GetEnvSettingWithBlankDefault ("oci_vault_secret_id" )
111107 vaultSecretIdStr := fmt .Sprintf ("variable \" oci_vault_secret_id\" { default = \" %s\" }\n " , vaultSecretId )
112108
@@ -122,7 +118,7 @@ func TestApigatewayGatewayResource_basic(t *testing.T) {
122118 acctest .ResourceTest (t , testAccCheckApigatewayGatewayDestroy , []resource.TestStep {
123119 // verify Create
124120 {
125- Config : config + compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceDependencies + caBundleIdVariableStr + certificateAuthorityIdVariableStr +
121+ Config : config + compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceDependencies +
126122 acctest .GenerateResourceFromRepresentationMap ("oci_apigateway_gateway" , "test_gateway" , acctest .Required , acctest .Create , gatewayRepresentation ),
127123 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
128124 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
@@ -148,12 +144,11 @@ func TestApigatewayGatewayResource_basic(t *testing.T) {
148144 },
149145 // verify Create with optionals
150146 {
151- Config : config + compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceDependencies + caBundleIdVariableStr + certificateAuthorityIdVariableStr +
147+ Config : config + compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceDependencies +
152148 acctest .GenerateResourceFromRepresentationMap ("oci_apigateway_gateway" , "test_gateway" , acctest .Optional , acctest .Create , gatewayRepresentation ),
153149 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
154150 resource .TestCheckResourceAttr (resourceName , "ca_bundles.#" , "1" ),
155151 resource .TestCheckResourceAttrSet (resourceName , "ca_bundles.0.ca_bundle_id" ),
156- resource .TestCheckResourceAttrSet (resourceName , "ca_bundles.0.certificate_authority_id" ),
157152 resource .TestCheckResourceAttr (resourceName , "ca_bundles.0.type" , "CA_BUNDLE" ),
158153 resource .TestCheckResourceAttrSet (resourceName , "certificate_id" ),
159154 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
@@ -189,15 +184,14 @@ func TestApigatewayGatewayResource_basic(t *testing.T) {
189184
190185 // verify Update to the compartment (the compartment will be switched back in the next step)
191186 {
192- Config : config + compartmentIdVariableStr + compartmentIdUVariableStr + vaultSecretIdStr + GatewayResourceDependencies + caBundleIdVariableStr + certificateAuthorityIdVariableStr +
187+ Config : config + compartmentIdVariableStr + compartmentIdUVariableStr + vaultSecretIdStr + GatewayResourceDependencies +
193188 acctest .GenerateResourceFromRepresentationMap ("oci_apigateway_gateway" , "test_gateway" , acctest .Optional , acctest .Create ,
194189 acctest .RepresentationCopyWithNewProperties (gatewayRepresentation , map [string ]interface {}{
195190 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id_for_update}` },
196191 })),
197192 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
198193 resource .TestCheckResourceAttr (resourceName , "ca_bundles.#" , "1" ),
199194 resource .TestCheckResourceAttrSet (resourceName , "ca_bundles.0.ca_bundle_id" ),
200- resource .TestCheckResourceAttrSet (resourceName , "ca_bundles.0.certificate_authority_id" ),
201195 resource .TestCheckResourceAttr (resourceName , "ca_bundles.0.type" , "CA_BUNDLE" ),
202196 resource .TestCheckResourceAttrSet (resourceName , "certificate_id" ),
203197 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentIdU ),
@@ -231,11 +225,10 @@ func TestApigatewayGatewayResource_basic(t *testing.T) {
231225
232226 // verify updates to updatable parameters
233227 {
234- Config : config + compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceDependencies + caBundleIdVariableStr + certificateAuthorityIdVariableStr +
228+ Config : config + compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceDependencies +
235229 acctest .GenerateResourceFromRepresentationMap ("oci_apigateway_gateway" , "test_gateway" , acctest .Optional , acctest .Update , gatewayRepresentation ),
236230 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
237231 resource .TestCheckResourceAttr (resourceName , "ca_bundles.#" , "1" ),
238- resource .TestCheckResourceAttrSet (resourceName , "ca_bundles.0.ca_bundle_id" ),
239232 resource .TestCheckResourceAttrSet (resourceName , "ca_bundles.0.certificate_authority_id" ),
240233 resource .TestCheckResourceAttr (resourceName , "ca_bundles.0.type" , "CERTIFICATE_AUTHORITY" ),
241234 resource .TestCheckResourceAttrSet (resourceName , "certificate_id" ),
@@ -271,7 +264,7 @@ func TestApigatewayGatewayResource_basic(t *testing.T) {
271264 {
272265 Config : config +
273266 acctest .GenerateDataSourceFromRepresentationMap ("oci_apigateway_gateways" , "test_gateways" , acctest .Optional , acctest .Update , gatewayDataSourceRepresentation ) +
274- compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceDependencies + caBundleIdVariableStr + certificateAuthorityIdVariableStr +
267+ compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceDependencies +
275268 acctest .GenerateResourceFromRepresentationMap ("oci_apigateway_gateway" , "test_gateway" , acctest .Optional , acctest .Update , gatewayRepresentation ),
276269 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
277270 resource .TestCheckResourceAttrSet (datasourceName , "certificate_id" ),
@@ -288,7 +281,7 @@ func TestApigatewayGatewayResource_basic(t *testing.T) {
288281 {
289282 Config : config +
290283 acctest .GenerateDataSourceFromRepresentationMap ("oci_apigateway_gateway" , "test_gateway" , acctest .Required , acctest .Create , gatewaySingularDataSourceRepresentation ) +
291- compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceConfig + caBundleIdVariableStr + certificateAuthorityIdVariableStr ,
284+ compartmentIdVariableStr + vaultSecretIdStr + GatewayResourceConfig ,
292285 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
293286 resource .TestCheckResourceAttrSet (singularDatasourceName , "gateway_id" ),
294287
0 commit comments