Skip to content

Commit 8aca681

Browse files
Xu ZhangSrividyaKamakshi
authored andcommitted
Added - Support for OIC: ZPR security attribute support for private endpoint
1 parent c906ab7 commit 8aca681

8 files changed

+130
-152
lines changed

examples/integration/main.tf

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ resource "oci_integration_integration_instance" "test_integration_instance" {
7272
#Required
7373
compartment_id = var.compartment_id
7474
integration_instance_type = var.instance_type
75+
76+
security_attributes = {
77+
"oracle-zpr.sensitivity.value" = "low"
78+
"oracle-zpr.sensitivity.mode" = "enforce"
79+
}
80+
7581
shape = "DEVELOPMENT"
7682
display_name = "instance-created-via-tf-${random_integer.seq.result}"
7783
is_byol = "false"
@@ -183,6 +189,8 @@ resource "oci_integration_private_endpoint_outbound_connection" "integration_pri
183189
depends_on = [
184190
oci_integration_oracle_managed_custom_endpoint.integretion_custom_endpoint
185191
]
192+
}
193+
186194
# resource "oci_integration_integration_instance" "test_integration_instance_idcs" {
187195
# #Required
188196
# compartment_id = var.compartment_id
@@ -195,23 +203,19 @@ resource "oci_integration_private_endpoint_outbound_connection" "integration_pri
195203
# idcs_at = var.integration_instance_idcs_access_token
196204
# }
197205

198-
resource "oci_integration_private_endpoint_outbound_connection" "integration_private_endpoint" {
199-
integration_instance_id = oci_integration_integration_instance.test_integration_instance.id
200-
nsg_ids = [var.nsg_id]
201-
subnet_id = var.subnet_id
202-
}
203-
204-
resource "oci_integration_integration_instance" "test_integration_instance_with_dr" {
205-
#Required
206-
compartment_id = var.compartment_id
207-
integration_instance_type = "STANDARDX"
208-
shape = "DEVELOPMENT"
209-
display_name = "DR"
210-
is_byol = "false"
211-
message_packs = "1"
212-
domain_id = var.domain_id
213-
is_disaster_recovery_enabled = "true"
214-
lifecycle {
215-
ignore_changes = ["system_tags"]
216-
}
217-
}
206+
# resource "oci_integration_integration_instance" "test_integration_instance_with_dr" {
207+
# #Required
208+
# compartment_id = var.compartment_id
209+
# integration_instance_type = var.instance_type
210+
# shape = "DEVELOPMENT"
211+
# display_name = "DR"
212+
# is_byol = "false"
213+
# message_packs = "1"
214+
# domain_id = var.domain_id
215+
#
216+
# is_disaster_recovery_enabled = "true"
217+
#
218+
# lifecycle {
219+
# ignore_changes = ["system_tags"]
220+
# }
221+
# }

internal/integrationtest/integration_integration_instance_test.go

Lines changed: 41 additions & 121 deletions
Large diffs are not rendered by default.

internal/service/integration/integration_integration_instance_data_source.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ func (s *IntegrationIntegrationInstanceDataSourceCrud) SetData() error {
130130

131131
if s.Res.IsDisasterRecoveryEnabled != nil {
132132
s.D.Set("is_disaster_recovery_enabled", *s.Res.IsDisasterRecoveryEnabled)
133+
} else {
134+
s.D.Set("is_disaster_recovery_enabled", false)
133135
}
134136

135137
if s.Res.IsFileServerEnabled != nil {
@@ -170,6 +172,10 @@ func (s *IntegrationIntegrationInstanceDataSourceCrud) SetData() error {
170172
s.D.Set("private_endpoint_outbound_connection", nil)
171173
}
172174

175+
s.D.Set("security_attributes", tfresource.SecurityAttributesToMap(s.Res.SecurityAttributes))
176+
177+
s.D.Set("shape", s.Res.Shape)
178+
173179
s.D.Set("state", s.Res.LifecycleState)
174180

175181
if s.Res.StateMessage != nil {

internal/service/integration/integration_integration_instance_resource.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,14 @@ func IntegrationIntegrationInstanceResource() *schema.Resource {
270270
},
271271
},
272272
},
273+
"security_attributes": {
274+
Type: schema.TypeMap,
275+
Optional: true,
276+
Computed: true,
277+
Elem: &schema.Schema{
278+
Type: schema.TypeString,
279+
},
280+
},
273281
"shape": {
274282
Type: schema.TypeString,
275283
Optional: true,
@@ -794,6 +802,10 @@ func (s *IntegrationIntegrationInstanceResourceCrud) Create() error {
794802
}
795803
}
796804

805+
if securityAttributes, ok := s.D.GetOkExists("security_attributes"); ok {
806+
request.SecurityAttributes = tfresource.MapToSecurityAttributes(securityAttributes.(map[string]interface{}))
807+
}
808+
797809
if shape, ok := s.D.GetOkExists("shape"); ok {
798810
request.Shape = oci_integration.CreateIntegrationInstanceDetailsShapeEnum(shape.(string))
799811
}
@@ -1050,6 +1062,10 @@ func (s *IntegrationIntegrationInstanceResourceCrud) Update() error {
10501062
request.MessagePacks = &tmp
10511063
}
10521064

1065+
if securityAttributes, ok := s.D.GetOkExists("security_attributes"); ok {
1066+
request.SecurityAttributes = tfresource.MapToSecurityAttributes(securityAttributes.(map[string]interface{}))
1067+
}
1068+
10531069
request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "integration")
10541070

10551071
response, err := s.Client.UpdateIntegrationInstance(context.Background(), request)
@@ -1192,6 +1208,10 @@ func (s *IntegrationIntegrationInstanceResourceCrud) SetData() error {
11921208
s.D.Set("private_endpoint_outbound_connection", nil)
11931209
}
11941210

1211+
s.D.Set("security_attributes", tfresource.SecurityAttributesToMap(s.Res.SecurityAttributes))
1212+
1213+
s.D.Set("shape", s.Res.Shape)
1214+
11951215
s.D.Set("state", s.Res.LifecycleState)
11961216

11971217
if s.Res.StateMessage != nil {

internal/service/integration/integration_integration_instances_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ func (s *IntegrationIntegrationInstancesDataSourceCrud) SetData() error {
156156

157157
if r.IsDisasterRecoveryEnabled != nil {
158158
integrationInstance["is_disaster_recovery_enabled"] = *r.IsDisasterRecoveryEnabled
159+
} else {
160+
integrationInstance["is_disaster_recovery_enabled"] = false
159161
}
160162

161163
if r.IsFileServerEnabled != nil {
@@ -196,6 +198,8 @@ func (s *IntegrationIntegrationInstancesDataSourceCrud) SetData() error {
196198
integrationInstance["private_endpoint_outbound_connection"] = nil
197199
}
198200

201+
integrationInstance["security_attributes"] = tfresource.SecurityAttributesToMap(r.SecurityAttributes)
202+
199203
integrationInstance["shape"] = r.Shape
200204

201205
integrationInstance["state"] = r.LifecycleState

website/docs/d/integration_integration_instance.html.markdown

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ The following attributes are exported:
5858
* `dns_zone_name` - DNS Zone name
5959
* `hostname` - A custom hostname to be used for the integration instance URL, in FQDN format.
6060
* `defined_tags` - Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}`
61-
* `disaster_recovery_details` - Disaster recovery details for the integration instance created in the region.
62-
* `cross_region_integration_instance_details` - Details of integration instance created in cross region for disaster recovery.
61+
* `disaster_recovery_details` - Disaster recovery details for the integration instance created in the region.
62+
* `cross_region_integration_instance_details` - Details of integration instance created in cross region for disaster recovery.
6363
* `id` - Cross region integration instance identifier
6464
* `region` - Cross region where integration instance is created
6565
* `role` - Role of the integration instance in the region
@@ -79,7 +79,7 @@ The following attributes are exported:
7979
* `idcs_app_name` - The IDCS application name associated with the instance
8080
* `instance_primary_audience_url` - The URL used as the primary audience for integration flows in this instance type: string* `instance_design_time_url` - The Integration Instance Design Time URL
8181
* `instance_url` - The Integration Instance URL.
82-
* `integration_instance_type` - Standard or Enterprise type, Oracle Integration Generation 2 uses ENTERPRISE and STANDARD, Oracle Integration 3 uses ENTERPRISEX and STANDARDX
82+
* `integration_instance_type` - Standard or Enterprise type, Oracle Integration Generation 2 uses ENTERPRISE and STANDARD, Oracle Integration 3 uses ENTERPRISEX, STANDARDX and HEALTHCARE
8383
* `is_byol` - Bring your own license.
8484
* `is_disaster_recovery_enabled` - Is Disaster Recovery enabled for the integrationInstance
8585
* `is_file_server_enabled` - The file server is enabled or not.
@@ -98,6 +98,12 @@ The following attributes are exported:
9898
* `nsg_ids` - One or more Network security group Ids. This is an optional argument.
9999
* `outbound_connection_type` - The type of Outbound Connection.
100100
* `subnet_id` - Customer Private Network VCN Subnet OCID. This is a required argument.
101+
* `security_attributes` - Security attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{
102+
"oracle-zpr.sensitivity.value" = "low"
103+
"oracle-zpr.sensitivity.mode" = "enforce"
104+
}
105+
`
106+
* `shape` - Shape
101107
* `state` - The current state of the integration instance.
102108
* `state_message` - An message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
103109
* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}`

website/docs/d/integration_integration_instances.html.markdown

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ The following attributes are exported:
7474
* `certificate_secret_version` - The secret version used for the certificate-secret-id (if certificate-secret-id is specified).* `dns_type` - Type of DNS.
7575
* `dns_zone_name` - DNS Zone name
7676
* `hostname` - A custom hostname to be used for the integration instance URL, in FQDN format.
77-
* `defined_tags` - Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}`
78-
* `disaster_recovery_details` - Disaster recovery details for the integration instance created in the region.
79-
* `cross_region_integration_instance_details` - Details of integration instance created in cross region for disaster recovery.
77+
* `defined_tags` - Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}`
78+
* `disaster_recovery_details` - Disaster recovery details for the integration instance created in the region.
79+
* `cross_region_integration_instance_details` - Details of integration instance created in cross region for disaster recovery.
8080
* `id` - Cross region integration instance identifier
8181
* `region` - Cross region where integration instance is created
8282
* `role` - Role of the integration instance in the region
@@ -96,7 +96,7 @@ The following attributes are exported:
9696
* `idcs_app_name` - The IDCS application name associated with the instance
9797
* `instance_primary_audience_url` - The URL used as the primary audience for integration flows in this instance type: string* `instance_design_time_url` - The Integration Instance Design Time URL
9898
* `instance_url` - The Integration Instance URL.
99-
* `integration_instance_type` - Standard or Enterprise type, Oracle Integration Generation 2 uses ENTERPRISE and STANDARD, Oracle Integration 3 uses ENTERPRISEX and STANDARDX
99+
* `integration_instance_type` - Standard or Enterprise type, Oracle Integration Generation 2 uses ENTERPRISE and STANDARD, Oracle Integration 3 uses ENTERPRISEX, STANDARDX and HEALTHCARE
100100
* `is_byol` - Bring your own license.
101101
* `is_disaster_recovery_enabled` - Is Disaster Recovery enabled for the integrationInstance
102102
* `is_file_server_enabled` - The file server is enabled or not.
@@ -115,6 +115,11 @@ The following attributes are exported:
115115
* `nsg_ids` - One or more Network security group Ids. This is an optional argument.
116116
* `outbound_connection_type` - The type of Outbound Connection.
117117
* `subnet_id` - Customer Private Network VCN Subnet OCID. This is a required argument.
118+
* `security_attributes` - Security attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{
119+
"oracle-zpr.sensitivity.value" = "low"
120+
"oracle-zpr.sensitivity.mode" = "enforce"
121+
}`
122+
* `shape` - Shape
118123
* `state` - The current state of the integration instance.
119124
* `state_message` - An message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
120125
* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}`

website/docs/r/integration_integration_instance.html.markdown

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ resource "oci_integration_integration_instance" "test_integration_instance" {
6262
}
6363
is_integration_vcn_allowlisted = var.integration_instance_network_endpoint_details_is_integration_vcn_allowlisted
6464
}
65+
66+
security_attributes = {
67+
"oracle-zpr.sensitivity.value" = "low"
68+
"oracle-zpr.sensitivity.mode" = "enforce"
69+
}
70+
6571
shape = var.integration_instance_shape
6672
state = var.integration_instance_target_state
6773
}
@@ -88,7 +94,6 @@ The following arguments are supported:
8894
* `domain_id` - (Optional) The OCID of the identity domain, that will be used to determine the corresponding Idcs Stripe and create an Idcs application within the stripe. This parameter is mutually exclusive with parameter: idcsAt, i.e only one of two parameters should be specified.
8995
* `freeform_tags` - (Optional) (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
9096
* `idcs_at` - (Optional) (Updatable) IDCS Authentication token. This is required for all realms with IDCS. Its optional as its not required for non IDCS realms.
91-
* `integration_instance_type` - (Required) (Updatable) Standard or Enterprise type, Oracle Integration Generation 2 uses ENTERPRISE and STANDARD, Oracle Integration 3 uses ENTERPRISEX and STANDARDX
9297
* `is_byol` - (Required) (Updatable) Bring your own license.
9398
* `is_disaster_recovery_enabled` - (Optional) Is Disaster Recovery enabled or not.
9499
* `is_file_server_enabled` - (Optional) (Updatable) The file server is enabled or not.
@@ -101,6 +106,10 @@ The following arguments are supported:
101106
* `id` - (Required) The Virtual Cloud Network OCID.
102107
* `is_integration_vcn_allowlisted` - (Optional) The Integration service's VCN is allow-listed to allow integrations to call back into other integrations
103108
* `network_endpoint_type` - (Required) The type of network endpoint.
109+
* `security_attributes` - (Optional) (Updatable) Security attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{
110+
"oracle-zpr.sensitivity.value" = "low"
111+
"oracle-zpr.sensitivity.mode" = "enforce"
112+
}`
104113
* `shape` - (Optional) Shape
105114
* `enable_process_automation_trigger` - (Optional) (Updatable) An optional property when incremented triggers Enable Process Automation. Could be set to any integer value.
106115
* `extend_data_retention_trigger` - (Optional) (Updatable) An optional property when incremented triggers Extend Data Retention. Could be set to any integer value.
@@ -130,8 +139,8 @@ The following attributes are exported:
130139
* `dns_zone_name` - DNS Zone name
131140
* `hostname` - A custom hostname to be used for the integration instance URL, in FQDN format.
132141
* `managed_type` - Indicates if custom endpoint is managed by oracle or customer.
133-
* `attachments` - A list of associated attachments to other services
134-
* `is_implicit` -
142+
* `attachments` - A list of associated attachments to other services
143+
* `is_implicit` -
135144
* If role == `PARENT`, the attached instance was created by this service instance
136145
* If role == `CHILD`, this instance was created from attached instance on behalf of a user
137146
* `target_id` - The OCID of the target instance (which could be any other Oracle Cloud Infrastructure PaaS/SaaS resource), to which this instance is attached.
@@ -176,9 +185,9 @@ The following attributes are exported:
176185
* `instance_url` - The Integration Instance URL.
177186
* `integration_instance_type` - Standard or Enterprise type, Oracle Integration Generation 2 uses ENTERPRISE and STANDARD, Oracle Integration 3 uses ENTERPRISEX and STANDARDX
178187
* `instance_url` - The Integration Instance URL.
188+
* `integration_instance_type` - Standard or Enterprise type, Oracle Integration Generation 2 uses ENTERPRISE and STANDARD, Oracle Integration 3 uses ENTERPRISEX, STANDARDX and HEALTHCARE
179189
* `instance_primary_audience_url` - The URL used as the primary audience for integration flows in this instance type: string
180190
* `instance_url` - The Integration Instance URL.
181-
* `integration_instance_type` - Standard or Enterprise type, Oracle Integration Generation 2 uses ENTERPRISE and STANDARD, Oracle Integration 3 uses ENTERPRISEX and STANDARDX
182191
* `is_byol` - Bring your own license.
183192
* `is_disaster_recovery_enabled` - Is Disaster Recovery enabled for the integrationInstance
184193
* `is_file_server_enabled` - The file server is enabled or not.
@@ -197,6 +206,10 @@ The following attributes are exported:
197206
* `nsg_ids` - One or more Network security group Ids. This is an optional argument.
198207
* `outbound_connection_type` - The type of Outbound Connection.
199208
* `subnet_id` - Customer Private Network VCN Subnet OCID. This is a required argument.
209+
* `security_attributes` - Security attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{
210+
"oracle-zpr.sensitivity.value" = "low"
211+
"oracle-zpr.sensitivity.mode" = "enforce"
212+
}`
200213
* `shape` - Shape
201214
* `state` - The current state of the integration instance.
202215
* `state_message` - An message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.

0 commit comments

Comments
 (0)