oci_stack_monitoring_monitored_resource

This resource provides the Monitored Resource resource in Oracle Cloud Infrastructure Stack Monitoring service.

Creates a new monitored resource for the given resource type with the details and submits a work request for promoting the resource to agent. Once the resource is successfully added to agent, resource state will be marked active.

Example Usage

resource "oci_stack_monitoring_monitored_resource" "test_monitored_resource" {
	#Required
	compartment_id = var.compartment_id
	name = var.monitored_resource_name
	type = var.monitored_resource_type

	#Optional
	additional_aliases {
		#Required
		credential {
			#Required
			name = var.monitored_resource_additional_aliases_credential_name
			service = var.monitored_resource_additional_aliases_credential_service
			source = var.monitored_resource_additional_aliases_credential_source
		}
		name = var.monitored_resource_additional_aliases_name
		source = var.monitored_resource_additional_aliases_source
	}
	additional_credentials {

		#Optional
		credential_type = var.monitored_resource_additional_credentials_credential_type
		description = var.monitored_resource_additional_credentials_description
		key_id = oci_kms_key.test_key.id
		name = var.monitored_resource_additional_credentials_name
		properties {

			#Optional
			name = var.monitored_resource_additional_credentials_properties_name
			value = var.monitored_resource_additional_credentials_properties_value
		}
		source = var.monitored_resource_additional_credentials_source
		type = var.monitored_resource_additional_credentials_type
	}
	aliases {
		#Required
		credential {
			#Required
			name = var.monitored_resource_aliases_credential_name
			service = var.monitored_resource_aliases_credential_service
			source = var.monitored_resource_aliases_credential_source
		}
		name = var.monitored_resource_aliases_name
		source = var.monitored_resource_aliases_source
	}
	credentials {

		#Optional
		credential_type = var.monitored_resource_credentials_credential_type
		description = var.monitored_resource_credentials_description
		key_id = var.monitored_resource_credentials_key_id
		name = var.monitored_resource_credentials_name
		properties {

			#Optional
			name = var.monitored_resource_credentials_properties_name
			value = var.monitored_resource_credentials_properties_value
		}
		source = var.monitored_resource_credentials_source
		type = var.monitored_resource_credentials_type
	}
	database_connection_details {
		#Required
		port = var.monitored_resource_database_connection_details_port
		protocol = var.monitored_resource_database_connection_details_protocol
		service_name = var.monitored_resource_database_service_name

		#Optional
		connector_id = var.monitored_resource_database_connector_id
		db_id = var.monitored_resource_database_id
		db_unique_name = var.monitored_resource_database_connection_details_db_unique_name
		ssl_secret_id = oci_vault_secret.test_secret.id
	}
	defined_tags = {"foo-namespace.bar-key"= "value"}
	display_name = var.monitored_resource_display_name
	external_resource_id = var.monitored_resource_external_resource_id
	external_id = oci_stack_monitoring_external.test_external.id
	freeform_tags = {"bar-key"= "value"}
	host_name = var.monitored_resource_host_name
	license = var.monitored_resource_license
	management_agent_id = oci_management_agent_management_agent.test_management_agent.id
	properties {

		#Optional
		name = var.monitored_resource_properties_name
		value = var.monitored_resource_properties_value
	}
	resource_time_zone = var.monitored_resource_resource_time_zone
}

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

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 Monitored Resource * update - (Defaults to 20 minutes), when updating the Monitored Resource * delete - (Defaults to 20 minutes), when destroying the Monitored Resource

Import

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

$ terraform import oci_stack_monitoring_monitored_resource.test_monitored_resource "id"