Skip to content

Commit e23414f

Browse files
Added tagging and related policies for migration.
1 parent 5f47e05 commit e23414f

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

identity.tf

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ resource "oci_identity_policy" "MigrationServicePolicy" {
7474
"Allow dynamic-group ${oci_identity_dynamic_group.MigrationDynamicGroup.name} { CAPACITY_RESERVATION_READ } in tenancy where any { request.operation='GetComputeCapacityReservation' }",
7575
"Allow dynamic-group ${oci_identity_dynamic_group.MigrationDynamicGroup.name} { ORGANIZATIONS_SUBSCRIPTION_INSPECT } in tenancy where any { request.operation='ListSubscriptions' }",
7676
"Allow dynamic-group ${oci_identity_dynamic_group.MigrationDynamicGroup.name} to read rate-cards in tenancy",
77-
"Allow dynamic-group ${oci_identity_dynamic_group.MigrationDynamicGroup.name} to use metrics in tenancy where target.metrics.namespace='ocb_asset'"
78-
77+
"Allow dynamic-group ${oci_identity_dynamic_group.MigrationDynamicGroup.name} to use metrics in tenancy where target.metrics.namespace='ocb_asset'",
78+
"Allow dynamic-group ${oci_identity_dynamic_group.MigrationDynamicGroup.name} to read tag-namespaces in tenancy",
79+
"Allow dynamic-group ${oci_identity_dynamic_group.MigrationDynamicGroup.name} to use tag-namespaces in tenancy where target.tag-namespace.name='CloudMigrations'"
7980
]
8081
}
8182

@@ -160,3 +161,37 @@ resource "oci_identity_policy" "HydrationAgentPolicy" {
160161
]
161162
}
162163

164+
resource "oci_identity_tag_namespace" "CloudMigrations" {
165+
name = "CloudMigrations"
166+
description = "Used to track resources created by Oracle Cloud Migrations service."
167+
compartment_id = var.tenancy_ocid
168+
}
169+
170+
resource "oci_identity_tag" "ServiceUse" {
171+
name = "ServiceUse"
172+
description = "Oracle Cloud Migrations serivce"
173+
tag_namespace_id = oci_identity_tag_namespace.CloudMigrations.id
174+
}
175+
176+
resource "oci_identity_tag" "SourceEnvironmentId" {
177+
name = "SourceEnvironmentId"
178+
description = "Source Environment OCID"
179+
tag_namespace_id = oci_identity_tag_namespace.CloudMigrations.id
180+
}
181+
resource "oci_identity_tag" "SourceEnvironmentType" {
182+
name = "SourceEnvironmentType"
183+
description = "Source Environment Type"
184+
tag_namespace_id = oci_identity_tag_namespace.CloudMigrations.id
185+
}
186+
187+
resource "oci_identity_tag" "SourceAssetId" {
188+
name = "SourceAssetId"
189+
description = "Asset Source OCID"
190+
tag_namespace_id = oci_identity_tag_namespace.CloudMigrations.id
191+
}
192+
193+
resource "oci_identity_tag" "MigrationProject" {
194+
name = "MigrationProject"
195+
description = "Migration Project OCID"
196+
tag_namespace_id = oci_identity_tag_namespace.CloudMigrations.id
197+
}

0 commit comments

Comments
 (0)