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:
managed_agent_id
- (Required) Unique Management Agent identifierdefined_tags
- (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:{"Operations.CostCenter": "42"}
display_name
- (Optional) (Updatable) New displayName of Agent.freeform_tags
- (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}
deploy_plugins_id
- (Optional) (Updatable) Plugin Id list to deploy to Management Agent. Once deployed, plugins cannot be undeployed.
** 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:
availability_status
- The current availability status of managementAgentcompartment_id
- Compartment Identifierdata_source_list
- list of dataSources associated with the agentallow_metrics
- Comma separated metric name list. The complete set of desired scraped metrics. Use this property to limit the set of metrics uploaded if required.compartment_id
- Compartment owning this DataSource.connection_timeout
- Number in milliseconds. The timeout for connecting to the Prometheus Exporter’s endpoint.is_daemon_set
- If the Kubernetes cluster type is Daemon set then this will be set to true.key
- Identifier for DataSource. This represents the type and name for the data source associated with the Management Agent.metric_dimensions
- The names of other user-supplied properties expressed as fixed values to be used as dimensions for every uploaded datapoint.name
- Name of the metric dimensionvalue
- Value of the metric dimension
name
- Unique name of the DataSource.namespace
- The Oracle Cloud Infrastructure monitoring namespace to which scraped metrics should be uploaded.proxy_url
- The url of the network proxy that provides access to the Prometheus Exporter’s endpoint (url required property).read_data_limit
- Number in kilobytes. The limit on the data being sent, not to exceed the agent’s fixed limit of 400 (KB).read_timeout
- Number in milliseconds. The timeout for reading the response from the Prometheus Exporter’s endpoint.resource_group
- Oracle Cloud Infrastructure monitoring resource group to assign the metric to.schedule_mins
- Number in minutes. The scraping occurs at the specified interval.state
- State of the DataSource.time_created
- The time the DataSource was created. An RFC3339 formatted datetime stringtime_updated
- The time the DataSource data was last received. An RFC3339 formatted datetime stringtype
- The type of the DataSource.url
- The url through which the Prometheus Exporter publishes its metrics. (http only)
defined_tags
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example:{"foo-namespace.bar-key": "value"}
display_name
- Management Agent Namefreeform_tags
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example:{"bar-key": "value"}
host
- Management Agent host machine namehost_id
- Host resource ocidid
- agent identifierinstall_key_id
- agent install key identifierinstall_path
- Path where Management Agent is installedinstall_type
- The install type, either AGENT or GATEWAYis_agent_auto_upgradable
- true if the agent can be upgraded automatically; false if it must be upgraded manually. This flag is derived from the tenancy level auto upgrade preference.is_customer_deployed
- true, if the agent image is manually downloaded and installed. false, if the agent is deployed as a plugin in Oracle Cloud Agent.lifecycle_details
- A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.management_agent_properties
- Additional properties for this Management Agentname
- Name of the propertyunits
- Unit for the propertyvalues
- Values of the property
platform_name
- Platform Nameplatform_type
- Platform Typeplatform_version
- Platform Versionplugin_list
- list of managementAgentPlugins associated with the agentis_enabled
- flag indicating whether the plugin is in enabled mode or disabled mode.plugin_display_name
- Management Agent Plugin Identifier, can be renamedplugin_id
- Plugin Idplugin_name
- Management Agent Plugin Nameplugin_status
- Plugin Statusplugin_status_message
- Status message of the Pluginplugin_version
- Plugin Version
resource_artifact_version
- Version of the deployment artifact instantiated by this Management Agent. The format for Standalone resourceMode is YYMMDD.HHMM, and the format for other modes (whose artifacts are based upon Standalone but can advance independently) is YYMMDD.HHMM.VVVVVVVVVVVV. VVVVVVVVVVVV is always a numeric value between 000000000000 and 999999999999state
- The current state of managementAgenttime_created
- The time the Management Agent was created. An RFC3339 formatted datetime stringtime_last_heartbeat
- The time the Management Agent has last recorded its health status in telemetry. This value will be null if the agent has not recorded its health status in last 7 days. An RFC3339 formatted datetime stringtime_updated
- The time the Management Agent was last updated. An RFC3339 formatted datetime stringversion
- Management Agent Version
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"