oci_management_agent_management_agent

This resource provides the Management Agent resource in Oracle Cloud Infrastructure Management Agent service.

Example Usage

resource "oci_management_agent_management_agent" "test_management_agent" {
	#Required
	managed_agent_id = oci_management_agent_managed_agent.test_managed_agent.id
}

Add plugin to Management Agent created via OCI Compute instance.

Compute instance must have OCA Plugin “Management Agent” enabled

resource "oci_core_instance" "instance" {
    .....
	agent_config {
	  ...
	  plugins_config {
		desired_state = "ENABLED"
		name          = "Management Agent"
	  }
	
	}
}
data "oci_management_agent_management_agents" "find_agent" {
  compartment_id   = var.compartment_ocid
  host_id          = oci_core_instance.instance.id
  wait_for_host_id = 10
}

data "oci_management_agent_management_agent_plugins" "test_management_agent_plugins" {
  compartment_id = var.compartment_ocid
  display_name   = "Logging Analytics"
}

resource "oci_management_agent_management_agent" "test_management_agent" {
  freeform_tags     = { "TestingTag" : "TestingValue" }
  managed_agent_id  = data.oci_management_agent_management_agents.find_agent.management_agents[0].id
  deploy_plugins_id = [data.oci_management_agent_management_agent_plugins.test_management_agent_plugins.management_agent_plugins.0.id]
}

Argument Reference

The following arguments are supported:

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Management Agent resources are not created or destroyed by terraform.

Management Agents should be created using on premise installation, or OCA plugin for Management Agent. See Management Agent.

Destroy operation in terraform will not delete the Management Agent, this must be performed by steps indicated in Management Agent. Destroy will remove the resource from terraform state only.

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Management Agent * update - (Defaults to 20 minutes), when updating the Management Agent * delete - (Defaults to 20 minutes), when destroying the Management Agent

Import

ManagementAgents can be imported using the id, e.g.

$ terraform import oci_management_agent_management_agent.test_management_agent "id"