@@ -30,11 +30,13 @@ var (
3030 "bastion_id" : Representation {RepType : Required , Create : `${oci_bastion_bastion.test_bastion.id}` },
3131 }
3232
33+ bastionName = RandomString (15 , charsetWithoutDigits )
34+
3335 bastionDataSourceRepresentation = map [string ]interface {}{
3436 "compartment_id" : Representation {RepType : Required , Create : `${var.compartment_id}` },
3537 "bastion_id" : Representation {RepType : Optional , Create : `${oci_bastion_bastion.test_bastion.id}` },
3638 "bastion_lifecycle_state" : Representation {RepType : Optional , Create : `ACTIVE` },
37- "name" : Representation {RepType : Optional , Create : `bastionterraformtest` },
39+ "name" : Representation {RepType : Optional , Create : bastionName },
3840 "filter" : RepresentationGroup {Required , bastionDataSourceFilterRepresentation }}
3941 bastionDataSourceFilterRepresentation = map [string ]interface {}{
4042 "name" : Representation {RepType : Required , Create : `id` },
4951 "defined_tags" : Representation {RepType : Optional , Create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , Update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
5052 "freeform_tags" : Representation {RepType : Optional , Create : map [string ]string {"bar-key" : "value" }, Update : map [string ]string {"Department" : "Accounting" }},
5153 "max_session_ttl_in_seconds" : Representation {RepType : Optional , Create : `1800` , Update : `3600` },
52- "name" : Representation {RepType : Required , Create : `bastionterraformtest` , Update : "BastionTerraformtest" },
54+ "name" : Representation {RepType : Required , Create : bastionName },
5355 }
5456
5557 BastionResourceDependencies = GenerateResourceFromRepresentationMap ("oci_core_subnet" , "test_subnet" , Required , Create , subnetRepresentation ) +
@@ -112,7 +114,7 @@ func TestBastionBastionResource_basic(t *testing.T) {
112114 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
113115 resource .TestCheckResourceAttrSet (resourceName , "id" ),
114116 resource .TestCheckResourceAttr (resourceName , "max_session_ttl_in_seconds" , "1800" ),
115- resource .TestCheckResourceAttr (resourceName , "name" , "bastionterraformtest" ),
117+ resource .TestCheckResourceAttr (resourceName , "name" , bastionName ),
116118 resource .TestCheckResourceAttrSet (resourceName , "state" ),
117119 resource .TestCheckResourceAttrSet (resourceName , "target_subnet_id" ),
118120 resource .TestCheckResourceAttrSet (resourceName , "target_vcn_id" ),
@@ -145,7 +147,7 @@ func TestBastionBastionResource_basic(t *testing.T) {
145147 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
146148 resource .TestCheckResourceAttrSet (resourceName , "id" ),
147149 resource .TestCheckResourceAttr (resourceName , "max_session_ttl_in_seconds" , "1800" ),
148- resource .TestCheckResourceAttr (resourceName , "name" , "bastionterraformtest" ),
150+ resource .TestCheckResourceAttr (resourceName , "name" , bastionName ),
149151 resource .TestCheckResourceAttrSet (resourceName , "state" ),
150152 resource .TestCheckResourceAttrSet (resourceName , "target_subnet_id" ),
151153 resource .TestCheckResourceAttrSet (resourceName , "target_vcn_id" ),
@@ -173,7 +175,7 @@ func TestBastionBastionResource_basic(t *testing.T) {
173175 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
174176 resource .TestCheckResourceAttrSet (resourceName , "id" ),
175177 resource .TestCheckResourceAttr (resourceName , "max_session_ttl_in_seconds" , "3600" ),
176- resource .TestCheckResourceAttr (resourceName , "name" , "bastionterraformtest" ),
178+ resource .TestCheckResourceAttr (resourceName , "name" , bastionName ),
177179 resource .TestCheckResourceAttrSet (resourceName , "state" ),
178180 resource .TestCheckResourceAttrSet (resourceName , "target_subnet_id" ),
179181 resource .TestCheckResourceAttrSet (resourceName , "target_vcn_id" ),
@@ -198,15 +200,15 @@ func TestBastionBastionResource_basic(t *testing.T) {
198200 resource .TestCheckResourceAttrSet (datasourceName , "bastion_id" ),
199201 resource .TestCheckResourceAttr (datasourceName , "bastion_lifecycle_state" , "ACTIVE" ),
200202 resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId ),
201- resource .TestCheckResourceAttr (datasourceName , "name" , "bastionterraformtest" ),
203+ resource .TestCheckResourceAttr (datasourceName , "name" , bastionName ),
202204
203205 resource .TestCheckResourceAttr (datasourceName , "bastions.#" , "1" ),
204206 resource .TestCheckResourceAttr (datasourceName , "bastions.0.bastion_type" , "STANDARD" ),
205207 resource .TestCheckResourceAttr (datasourceName , "bastions.0.compartment_id" , compartmentId ),
206208 resource .TestCheckResourceAttr (datasourceName , "bastions.0.defined_tags.%" , "1" ),
207209 resource .TestCheckResourceAttr (datasourceName , "bastions.0.freeform_tags.%" , "1" ),
208210 resource .TestCheckResourceAttrSet (datasourceName , "bastions.0.id" ),
209- resource .TestCheckResourceAttr (datasourceName , "bastions.0.name" , "bastionterraformtest" ),
211+ resource .TestCheckResourceAttr (datasourceName , "bastions.0.name" , bastionName ),
210212 resource .TestCheckResourceAttrSet (datasourceName , "bastions.0.state" ),
211213 resource .TestCheckResourceAttrSet (datasourceName , "bastions.0.target_subnet_id" ),
212214 resource .TestCheckResourceAttrSet (datasourceName , "bastions.0.target_vcn_id" ),
@@ -230,7 +232,7 @@ func TestBastionBastionResource_basic(t *testing.T) {
230232 resource .TestCheckResourceAttrSet (singularDatasourceName , "id" ),
231233 resource .TestCheckResourceAttr (singularDatasourceName , "max_session_ttl_in_seconds" , "3600" ),
232234 resource .TestCheckResourceAttrSet (singularDatasourceName , "max_sessions_allowed" ),
233- resource .TestCheckResourceAttr (singularDatasourceName , "name" , "bastionterraformtest" ),
235+ resource .TestCheckResourceAttr (singularDatasourceName , "name" , bastionName ),
234236 resource .TestCheckResourceAttrSet (singularDatasourceName , "private_endpoint_ip_address" ),
235237 resource .TestCheckResourceAttrSet (singularDatasourceName , "state" ),
236238 resource .TestCheckResourceAttrSet (singularDatasourceName , "target_vcn_id" ),
0 commit comments