This module contains a collection of submodules that simplify the managment of Identity and Access Management (IAM) resources such as compartments, users, groups, and dynamic groups for Oracle Cloud Infrastructure. For more information about IAM, see Overview of IAM.
See the Oracle Cloud Infrastructure Terraform Provider docs for information about setting up and using the Oracle Cloud Infrastructure Terraform Provider.
This module has the following folder structure:
- modules: This folder includes submodules for creating IAM resources in Oracle Cloud Infrastructure.
- example: This folder contains an example of how to use the module.
The available submodules are listed below.
iam-compartment
: See a basic example below and the iam-compartment readme for details.
module "iam_compartment" {
source = "oracle-terraform-modules/iam/oci/modules/iam-compartment"
tenancy_ocid = "${var.tenancy_ocid}"
compartment_name = "tf_example_compartment"
compartment_description = "compartment created by terraform"
compartment_create = false
}
iam-user
: See a basic example below and the iam-user readme for details.
module "iam_user1" {
source = "oracle-terraform-modules/iam/oci/modules/iam-user"
tenancy_ocid = "${var.tenancy_ocid}"
user_name = "[email protected]"
user_description = "user1 created by terraform"
}
iam-group
: See a basic example below and the iam-group readme for details.
module "iam_group" {
source = "oracle-terraform-modules/iam/oci/modules/iam-group"
tenancy_ocid = "${var.tenancy_ocid}"
group_name = "tf_example_group"
group_description = "group created by terraform"
user_count = 2
user_ids = ["${module.iam_user1.user_id}", "${module.iam_user2.user_id}"]
policy_compartment_id = "${module.iam_compartment.compartment_id}"
policy_name = "tf-example-policy"
policy_description = "policy created by terraform"
policy_statements = ["Allow group tf_example_group to read instances in compartment tf_example_compartment", "Allow group tf_example_group to inspect instances in compartment tf_example_compartment"]
}
iam-dynamic-group
: See a basic example below and the iam-dynamic-group readme for details.
module "iam_dynamic_group" {
source = "oracle-terraform-modules/iam/oci/modules/iam-dynamic-group"
tenancy_ocid = "${var.tenancy_ocid}"
dynamic_group_name = "tf_example_dynamic_group"
dynamic_group_description = "dynamic group created by terraform"
dynamic_group_rule = "instance.compartment.id = '${module.iam_compartment.compartment_id}'"
policy_compartment_id = "${module.iam_compartment.compartment_id}"
policy_name = "tf-example-dynamic-policy"
policy_description = "dynamic policy created by terraform"
policy_statements = ["Allow dynamic-group tf_example_dynamic_group to read instances in compartment tf_example_compartment"]
}
This project is open source. Oracle appreciates any contributions that are made by the open source community.
Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License 1.0 or Apache License 2.0.
See LICENSE for more details.