Skip to content

Commit c3ef0b1

Browse files
Added copyright and compartment variables.
1 parent 0831f0e commit c3ef0b1

File tree

8 files changed

+54
-16
lines changed

8 files changed

+54
-16
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Overview
2-
This repository related to the [prerequisites](https://docs.oracle.com/en-us/iaas/Content/cloud-migration/cloud-migration-get-started.htm#cloud-migration-prerequisites-ocm) needed to use Oracle Cloud Migrations.
2+
This Terraform implements the [prerequisites](https://docs.oracle.com/en-us/iaas/Content/cloud-migration/cloud-migration-get-started.htm#cloud-migration-prerequisites-ocm) needed to use Oracle Cloud Migrations for migrating VMware VM's to Oracle Cloud Infrastructure.
33

4-
# Included Resources
4+
# Deployed Resources
55

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.
10-
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.

datasources.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
data "oci_identity_tenancy" "tenancy" {
25
tenancy_id = var.tenancy_ocid
36
}

identity.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
## Copyright © 2021, Oracle and/or its affiliates.
2-
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
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.
33

44
resource "oci_identity_compartment" "Migration" {
55
provider = oci.homeregion
6-
name = "Migration"
6+
name = var.migration_compartment
77
description = "Compartment for OCM resources."
88
compartment_id = var.tenancy_ocid
9-
enable_delete = false
109
}
1110
resource "oci_identity_compartment" "MigrationSecrets" {
1211
provider = oci.homeregion
13-
name = "MigrationSecrets"
12+
name = var.migration_secrets_compartment
1413
description = "Compartment for OCM secrets."
1514
compartment_id = var.tenancy_ocid
16-
enable_delete = false
1715
}
1816

1917
resource "oci_identity_dynamic_group" "MigrationDynamicGroup" {

kms_vault.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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_kms_vault" "OCMSecrets" {
5+
display_name = "OCMSecrets"
6+
compartment_id = oci_identity_compartment.MigrationSecrets.id
7+
vault_type = "DEFAULT"
8+
}
9+
10+
resource "oci_kms_key" "MainKey" {
11+
compartment_id = oci_identity_compartment.MigrationSecrets.id
12+
display_name = "MainKey"
13+
key_shape {
14+
algorithm = "AES"
15+
length = "32"
16+
}
17+
management_endpoint = oci_kms_vault.OCMSecrets.management_endpoint
18+
}

object_storage.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
resource "oci_objectstorage_bucket" "ReplicationBucket" {
25
compartment_id = oci_identity_compartment.Migration.id
36
name = var.replication_bucket

provider.tf

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
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+
14
provider "oci" {
2-
tenancy_ocid = var.tenancy_ocid
5+
tenancy_ocid = var.tenancy_ocid
36
user_ocid = var.user_ocid
47
fingerprint = var.fingerprint
58
private_key_path = var.private_key_path
6-
region = var.region
9+
region = var.region
710
}
811

912
# ## Required for IAM resource creation. IAM resource must be created in the tenancy home region.
1013
provider "oci" {
11-
alias = "homeregion"
12-
tenancy_ocid = var.tenancy_ocid
14+
alias = "homeregion"
15+
tenancy_ocid = var.tenancy_ocid
1316
user_ocid = var.user_ocid
1417
fingerprint = var.fingerprint
1518
private_key_path = var.private_key_path
16-
region = local.home_region
19+
region = local.home_region
1720
}
1821

1922
locals {

service_logging_oc1.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
resource "oci_identity_policy" "HydrationAgentLoggingPolicy" {
25
provider = oci.homeregion
36
name = "HydrationAgentLoggingPolicy"

variables.tf

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
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+
14
variable "tenancy_ocid" {}
25
variable "user_ocid" {}
36
variable "fingerprint" {}
47
variable "private_key_path" {}
58
variable "region" {}
69

710
variable "replication_bucket" {
8-
default = "ocm_replication"
11+
default = "ocm_replication"
12+
}
13+
14+
variable "migration_compartment" {
15+
default = "Migration"
16+
}
17+
18+
variable "migration_secrets_compartment" {
19+
default = "MigrationSecrets"
920
}

0 commit comments

Comments
 (0)