Skip to content

Commit 85876a6

Browse files
Merging branch for migrated resource tagging.
Tagging of migrated resources.
2 parents ba33718 + 3c853f5 commit 85876a6

File tree

3 files changed

+47
-3
lines changed

3 files changed

+47
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ This Terraform implements the [prerequisites](https://docs.oracle.com/en-us/iaas
66
- Compartments - The recommended Migration and MigrationSecrets [compartments](https://docs.oracle.com/en-us/iaas/Content/cloud-migration/cloud-migration-get-started.htm#cloud-migration-recommendations-compartments).
77
- OCI Vault and Key - The vault used to store [vCenter credentials](https://docs.oracle.com/en-us/iaas/Content/cloud-migration/cloud-migration-remote-agent-appliance.htm#cloud-migration-vsphere-privileges).
88
- Object Storage Bucket - The Object Storage [bucket](https://docs.oracle.com/en-us/iaas/Content/cloud-migration/cloud-migration-understand-vm-replication.htm#cloud-migration-replication-bucket) used for transferring vSphere snapshot data into OCI.
9-
- Mandatory Serivce Policies - The mandatory [service policies](https://docs.oracle.com/en-us/iaas/Content/cloud-migration/cloud-migration-servicepolicies.htm) and assoicated dynamic groups needed for OCM serivce components to function.
9+
- Mandatory Service Policies - The mandatory [service policies](https://docs.oracle.com/en-us/iaas/Content/cloud-migration/cloud-migration-servicepolicies.htm) and associated dynamic groups needed for OCM service components to function.
10+
- Oracle Cloud Bridge Inventory - The [Inventory](https://docs.oracle.com/en-us/iaas/Content/cloud-migration/cloud-migration-inventory.htm) used to store discovered assets for migration.
11+
- Tag Namespace and Tags - The tag namespace and tags used by Oracle Cloud Migrations to keep track of [migrated resources](https://docs.oracle.com/en-us/iaas/Content/cloud-migration/cloud-migration-get-started.htm#cloud-migration-prerequisites-ocm).

cloudbridge.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Copyright (c) 2019-2022 Oracle and/or its affiliates.
2+
## Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
resource "oci_cloud_bridge_inventory" "Inventory" {
5+
compartment_id = var.tenancy_ocid
6+
display_name = "Inventory"
7+
}

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 service"
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)