### Install go-colorable Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/mattn/go-colorable/README.md Command to install the package via go get. ```bash $ go get github.com/mattn/go-colorable ``` -------------------------------- ### Example installation output Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/hashicorp/hc-install/README.md Shows the expected terminal output after successfully running the installation command. ```sh hc-install: will install terraform@1.3.7 installed terraform@1.3.7 to /current/working/dir/terraform ``` -------------------------------- ### Install color library Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/fatih/color/README.md Use the go get command to install the package. ```bash go get github.com/fatih/color ``` -------------------------------- ### Install go-isatty Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/mattn/go-isatty/README.md Command to install the package using the go get tool. ```bash $ go get github.com/mattn/go-isatty ``` -------------------------------- ### Install MessagePack library Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/vmihailenco/msgpack/README.md Use the go get command to install the package into your Go environment. ```shell go get -u github.com/vmihailenco/msgpack ``` -------------------------------- ### Install go-version library Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/hashicorp/go-version/README.md Use the standard go get command to add the library to your project. ```bash $ go get github.com/hashicorp/go-version ``` -------------------------------- ### Install MessagePack Library Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/vmihailenco/msgpack/v5/README.md Install the v5 version of the msgpack library using go get. ```shell go get github.com/vmihailenco/msgpack/v5 ``` -------------------------------- ### Wrap String Example in Go Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/mitchellh/go-wordwrap/README.md Demonstrates basic usage of the WrapString function from the wordwrap package to wrap a given string to a specified width. Ensure the wordwrap package is installed via 'go get github.com/mitchellh/go-wordwrap'. ```go wrapped := wordwrap.WrapString("foo bar baz", 3) fmt.Println(wrapped) ``` -------------------------------- ### Install copystructure Go Library Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/mitchellh/copystructure/README.md Use `go get` to install the copystructure library. This is the standard method for obtaining Go packages. ```bash go get github.com/mitchellh/copystructure ``` -------------------------------- ### Install yaml package Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/gopkg.in/yaml.v2/README.md Command to install the package via go get. ```bash go get gopkg.in/yaml.v2 ``` -------------------------------- ### Install the YAML package Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/gopkg.in/yaml.v3/README.md Use the go get command to add the package to your project. ```bash go get gopkg.in/yaml.v3 ``` -------------------------------- ### Install pkcs8 package Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/youmark/pkcs8/README.md Use this command to install the pkcs8 package via go get. ```text go get github.com/youmark/pkcs8 ``` -------------------------------- ### Install mapstructure Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/mitchellh/mapstructure/README.md Use the standard go get command to add the library to your project. ```bash $ go get github.com/mitchellh/mapstructure ``` -------------------------------- ### Install tagparser library Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/vmihailenco/tagparser/v2/README.md Use the go get command to add the library to your project dependencies. ```shell go get github.com/vmihailenco/tagparser/v2 ``` -------------------------------- ### Example OCI Core Instance Configuration Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/r/core_instance_configuration.html.markdown This snippet shows a comprehensive example of configuring an OCI core instance, including optional and required parameters for launch details, platform configuration, preemptible instance settings, shape configuration, and source details. ```terraform resource "oci_core_instance" "test_instance" { #Required availability_domain = var.instance_configuration_availability_domain compartment_id = var.compartment_id shape = var.instance_configuration_shape #Optional instance_configuration = { instance_details = { availability_config { recovery_action = var.instance_configuration_instance_details_availability_config_recovery_action } create_vnic_details { assign_public_ip = var.instance_configuration_instance_details_create_vnic_details_assign_public_ip defined_tags = var.instance_configuration_instance_details_create_vnic_details_defined_tags display_name = var.instance_configuration_instance_details_create_vnic_details_display_name hostname_label = var.instance_configuration_instance_details_create_vnic_details_hostname_label nsg_ids = var.instance_configuration_instance_details_create_vnic_details_nsg_ids private_ip = var.instance_configuration_instance_details_create_vnic_details_private_ip subnet_id = var.instance_configuration_instance_details_create_vnic_details_subnet_id } dedicated_vm_host_id = var.instance_configuration_instance_details_dedicated_vm_host_id freeform_tags = var.instance_configuration_instance_details_freeform_tags instance_options { #Optional load_balancers { #Optional load_balancer_id = var.instance_configuration_instance_details_instance_options_load_balancers_load_balancer_id } } ipxe_script_url = var.instance_configuration_instance_details_ipxe_script_url launch_details { #Optional agent_config { #Optional is_monitoring_disabled = var.instance_configuration_instance_details_launch_details_agent_config_is_monitoring_disabled plugins_config { #Optional desired_state = var.instance_configuration_instance_details_launch_details_agent_config_plugins_config_desired_state name = var.instance_configuration_instance_details_launch_details_agent_config_plugins_config_name } } assign_private_dns_record = var.instance_configuration_instance_details_launch_details_assign_private_dns_record assign_public_ip = var.instance_configuration_instance_details_launch_details_assign_public_ip boot_volume_vpus_per_gb = var.instance_configuration_instance_details_launch_details_boot_volume_vpus_per_gb capacity_reservation_id = var.instance_configuration_instance_details_launch_details_capacity_reservation_id cloud_init_file_urls = var.instance_configuration_instance_details_launch_details_cloud_init_file_urls compute_local_disk_configs { #Optional append_number_to_device_name = var.instance_configuration_instance_details_launch_details_compute_local_disk_configs_append_number_to_device_name name = var.instance_configuration_instance_details_launch_details_compute_local_disk_configs_name size_in_gbs = var.instance_configuration_instance_details_launch_details_compute_local_disk_configs_size_in_gbs } create_vnic_details { #Optional assign_public_ip = var.instance_configuration_instance_details_launch_details_create_vnic_details_assign_public_ip defined_tags = var.instance_configuration_instance_details_launch_details_create_vnic_details_defined_tags display_name = var.instance_configuration_instance_details_launch_details_create_vnic_details_display_name hostname_label = var.instance_configuration_instance_details_launch_details_create_vnic_details_hostname_label nsg_ids = var.instance_configuration_instance_details_launch_details_create_vnic_details_nsg_ids private_ip = var.instance_configuration_instance_details_launch_details_create_vnic_details_private_ip subnet_id = var.instance_configuration_instance_details_launch_details_create_vnic_details_subnet_id } custom_image_details { #Optional display_name = var.instance_configuration_instance_details_launch_details_custom_image_details_display_name image_id = var.instance_configuration_instance_details_launch_details_custom_image_details_image_id } defined_tags = var.instance_configuration_instance_details_launch_details_defined_tags display_name = var.instance_configuration_instance_details_launch_details_display_name freeform_tags = var.instance_configuration_instance_details_launch_details_freeform_tags instance_access_config { #Optional access_type = var.instance_configuration_instance_details_launch_details_instance_access_config_access_type boot_volume_data_image_id = var.instance_configuration_instance_details_launch_details_instance_access_config_boot_volume_data_image_id boot_volume_id = var.instance_configuration_instance_details_launch_details_instance_access_config_boot_volume_id boot_volume_kms_key_id = var.instance_configuration_instance_details_launch_details_instance_access_config_boot_volume_kms_key_id boot_volume_source_details { #Optional boot_volume_id = oci_core_boot_volume.test_boot_volume.id boot_volume_size_in_gbs = var.instance_configuration_instance_details_launch_details_instance_access_config_boot_volume_source_details_boot_volume_size_in_gbs boot_volume_vpus_per_gb = var.instance_configuration_instance_details_launch_details_instance_access_config_boot_volume_source_details_boot_volume_vpus_per_gb image_id = oci_core_image.test_image.id kms_key_id = oci_kms_key.test_key.id source_type = var.instance_configuration_instance_details_launch_details_instance_access_config_boot_volume_source_details_source_type } } instance_id = var.instance_configuration_instance_details_launch_details_instance_id licensing_configs { #Optional license_type = var.instance_configuration_instance_details_launch_details_licensing_configs_license_type } metadata = var.instance_configuration_instance_details_launch_details_metadata placement_constraint_details { #Required compute_host_group_id = oci_core_compute_host_group.test_compute_host_group.id type = var.instance_configuration_instance_details_launch_details_placement_constraint_details_type } platform_config { #Required type = var.instance_configuration_instance_details_launch_details_platform_config_type #Optional are_virtual_instructions_enabled = var.instance_configuration_instance_details_launch_details_platform_config_are_virtual_instructions_enabled config_map = var.instance_configuration_instance_details_launch_details_platform_config_config_map is_access_control_service_enabled = var.instance_configuration_instance_details_launch_details_platform_config_is_access_control_service_enabled is_input_output_memory_management_unit_enabled = var.instance_configuration_instance_details_launch_details_platform_config_is_input_output_memory_management_unit_enabled is_measured_boot_enabled = var.instance_configuration_instance_details_launch_details_platform_config_is_measured_boot_enabled is_memory_encryption_enabled = var.instance_configuration_instance_details_launch_details_platform_config_is_memory_encryption_enabled is_secure_boot_enabled = var.instance_configuration_instance_details_launch_details_platform_config_is_secure_boot_enabled is_symmetric_multi_threading_enabled = var.instance_configuration_instance_details_launch_details_platform_config_is_symmetric_multi_threading_enabled is_trusted_platform_module_enabled = var.instance_configuration_instance_details_launch_details_platform_config_is_trusted_platform_module_enabled numa_nodes_per_socket = var.instance_configuration_instance_details_launch_details_platform_config_numa_nodes_per_socket percentage_of_cores_enabled = var.instance_configuration_instance_details_launch_details_platform_config_percentage_of_cores_enabled } preemptible_instance_config { #Optional preemption_action { #Required type = var.instance_configuration_instance_details_launch_details_preemptible_instance_config_preemption_action_type #Optional preserve_boot_volume = var.instance_configuration_instance_details_launch_details_preemptible_instance_config_preemption_action_preserve_boot_volume } } preferred_maintenance_action = var.instance_configuration_instance_details_launch_details_preferred_maintenance_action security_attributes = var.instance_configuration_instance_details_launch_details_security_attributes shape = var.instance_configuration_instance_details_launch_details_shape shape_config { #Optional baseline_ocpu_utilization = var.instance_configuration_instance_details_launch_details_shape_config_baseline_ocpu_utilization local_volume_size_in_gbs = var.instance_configuration_instance_details_launch_details_shape_config_local_volume_size_in_gbs memory_in_gbs = var.instance_configuration_instance_details_launch_details_shape_config_memory_in_gbs nvmes = var.instance_configuration_instance_details_launch_details_shape_config_nvmes ocpus = var.instance_configuration_instance_details_launch_details_shape_config_ocpus resource_management = var.instance_configuration_instance_details_launch_details_shape_config_resource_management vcpus = var.instance_configuration_instance_details_launch_details_shape_config_vcpus } source_details { #Required source_type = var.instance_configuration_instance_details_launch_details_source_details_source_type #Optional boot_volume_id = oci_core_boot_volume.test_boot_volume.id boot_volume_size_in_gbs = var.instance_configuration_instance_details_launch_details_source_details_boot_volume_size_in_gbs boot_volume_vpus_per_gb = var.instance_configuration_instance_details_launch_details_source_details_boot_volume_vpus_per_gb image_id = oci_core_image.test_image.id kms_key_id = oci_kms_key.test_key.id instance_source_image_filter_details { #Optional compartment_id = var.compartment_id defined_tags_filter = var.instance_configuration_instance_details_launch_details_source_details_instance_source_image_filter_details_defined_tags_filter operating_system = var.instance_configuration_instance_details_launch_details_source_details_instance_source_image_filter_details_operating_system operating_system_version = var.instance_configuration_instance_details_launch_details_source_details_instance_source_image_filter_details_operating_system_version } } } options { #Optional block_volumes { #Optional attach_details { #Required type = var.instance_configuration_instance_details_options_block_volumes_attach_details_type } } } } } } ``` -------------------------------- ### Example OCI Core Instance Configuration Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/r/core_instance_configuration.html.markdown This snippet shows a comprehensive configuration for an OCI core instance, including availability configuration, network details, and launch options. It utilizes variables for dynamic values and references other OCI resources. ```terraform resource "oci_core_instance" "test_instance" { #Optional is_live_migration_preferred = var.instance_configuration_instance_details_launch_details_availability_config_is_live_migration_preferred recovery_action = var.instance_configuration_instance_details_launch_details_availability_config_recovery_action } availability_domain = var.instance_configuration_instance_details_launch_details_availability_domain capacity_reservation_id = oci_core_capacity_reservation.test_capacity_reservation.id cluster_placement_group_id = oci_identity_group.test_group.id compartment_id = var.compartment_id compute_cluster_id = oci_core_compute_cluster.test_compute_cluster.id create_vnic_details { #Optional assign_ipv6ip = var.instance_configuration_instance_details_launch_details_create_vnic_details_assign_ipv6ip assign_private_dns_record = var.instance_configuration_instance_details_launch_details_create_vnic_details_assign_private_dns_record assign_public_ip = var.instance_configuration_instance_details_launch_details_create_vnic_details_assign_public_ip defined_tags = {"Operations.CostCenter"= "42"} display_name = var.instance_configuration_instance_details_launch_details_create_vnic_details_display_name freeform_tags = {"Department"= "Finance"} hostname_label = var.instance_configuration_instance_details_launch_details_create_vnic_details_hostname_label ipv6address_ipv6subnet_cidr_pair_details { #Optional ipv6address = var.instance_configuration_instance_details_launch_details_create_vnic_details_ipv6address_ipv6subnet_cidr_pair_details_ipv6address ipv6id = oci_core_ipv6.test_ipv6.id ipv6subnet_cidr = var.instance_configuration_instance_details_launch_details_create_vnic_details_ipv6address_ipv6subnet_cidr_pair_details_ipv6subnet_cidr } nsg_ids = var.instance_configuration_instance_details_launch_details_create_vnic_details_nsg_ids private_ip = var.instance_configuration_instance_details_launch_details_create_vnic_details_private_ip private_ip_id = oci_core_private_ip.test_private_ip.id security_attributes = var.instance_configuration_instance_details_launch_details_create_vnic_details_security_attributes skip_source_dest_check = var.instance_configuration_instance_details_launch_details_create_vnic_details_skip_source_dest_check subnet_cidr = var.instance_configuration_instance_details_launch_details_create_vnic_details_subnet_cidr subnet_id = oci_core_subnet.test_subnet.id } dedicated_vm_host_id = oci_core_dedicated_vm_host.test_dedicated_vm_host.id defined_tags = {"Operations.CostCenter"= "42"} display_name = var.instance_configuration_instance_details_launch_details_display_name extended_metadata = var.instance_configuration_instance_details_launch_details_extended_metadata fault_domain = var.instance_configuration_instance_details_launch_details_fault_domain freeform_tags = {"Department"= "Finance"} instance_options { #Optional are_legacy_imds_endpoints_disabled = var.instance_configuration_instance_details_launch_details_instance_options_are_legacy_imds_endpoints_disabled } ipxe_script = var.instance_configuration_instance_details_launch_details_ipxe_script is_ai_enterprise_enabled = var.instance_configuration_instance_details_launch_details_is_ai_enterprise_enabled is_pv_encryption_in_transit_enabled = var.instance_configuration_instance_details_launch_details_is_pv_encryption_in_transit_enabled launch_mode = var.instance_configuration_instance_details_launch_details_launch_mode launch_options { #Optional boot_volume_type = var.instance_configuration_instance_details_launch_details_launch_options_boot_volume_type firmware = var.instance_configuration_instance_details_launch_details_launch_options_firmware is_consistent_volume_naming_enabled = var.instance_configuration_instance_details_launch_details_launch_options_is_consistent_volume_naming_enabled is_pv_encryption_in_transit_enabled = var.instance_configuration_instance_details_launch_details_launch_options_is_pv_encryption_in_transit_enabled network_type = var.instance_configuration_instance_details_launch_details_launch_options_network_type remote_data_volume_type = var.instance_configuration_instance_details_launch_details_launch_options_remote_data_volume_type } licensing_configs { #Required type = var.instance_configuration_instance_details_launch_details_licensing_configs_type } ``` -------------------------------- ### Instance Platform Configuration Example Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/core_instance_configurations.html.markdown Configure platform-specific settings for an instance, such as virtualization instructions, access control, and memory management. Defaults are used if parameters are omitted. ```json "platform_config" : { "are_virtual_instructions_enabled" : true, "is_access_control_service_enabled" : true, "is_input_output_memory_management_unit_enabled" : true, "is_measured_boot_enabled" : true, "is_memory_encryption_enabled" : true, "is_secure_boot_enabled" : true, "is_symmetric_multi_threading_enabled" : true, "is_trusted_platform_module_enabled" : true, "numa_nodes_per_socket" : 1, "percentage_of_cores_enabled" : 100, "type" : "AMD_OPTIMIZED" } ``` -------------------------------- ### Yamux Server Setup and Stream Handling Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/hashicorp/yamux/README.md Illustrates how to set up a Yamux server session to accept incoming TCP connections and handle streams, including receiving data. Assumes a listener is already set up. ```go func server() { // Accept a TCP connection conn, err := listener.Accept() if err != nil { panic(err) } // Setup server side of yamux session, err := yamux.Server(conn, nil) if err != nil { panic(err) } // Accept a stream stream, err := session.Accept() if err != nil { panic(err) } // Listen for a message buf := make([]byte, 4) stream.Read(buf) } ``` -------------------------------- ### Get a list of Agent Installers Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/jms_agent_installers.html.markdown Use this data source to get a list of agent installers. Optional filters include compartment ID, fleet ID, OS family, and platform architecture. ```hcl data "oci_jms_agent_installers" "test_agent_installers" { #Optional compartment_id = var.compartment_id fleet_id = oci_jms_fleet.test_fleet.id os_family = var.agent_installer_os_family platform_architecture = var.agent_installer_platform_architecture } ``` -------------------------------- ### LaunchInstanceDetails Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/r/core_instance_configuration.html.markdown Details for launching an instance, including agent configuration and boot volume source. ```APIDOC ## LaunchInstanceDetails ### Description Instance launch details for creating an instance from an instance configuration. Use the `sourceDetails` parameter to specify whether a boot volume or an image should be used to launch a new instance. ### Parameters #### Request Body - **agent_config** (object) - Configuration options for the Oracle Cloud Agent software running on the instance. - **are_all_plugins_disabled** (boolean) - Whether Oracle Cloud Agent can run all the available plugins. This includes the management and monitoring plugins. - **is_management_disabled** (boolean) - Whether Oracle Cloud Agent can run all the available management plugins. Default value is false (management plugins are enabled). ``` -------------------------------- ### Instance Configuration Arguments Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/r/core_instance_configuration.html.markdown This section outlines the various arguments that can be used to configure an instance, including details about boot volumes, instance launch settings, and performance tuning options. ```APIDOC ## Instance Configuration Arguments ### Description Arguments for configuring core instance details, including launch parameters and volume settings. ### Arguments * `instance_type` - (Required) The type of instance details. Supported instanceType is compute. * `launch_details` - (Applicable when instance_type=compute) Instance launch details for creating an instance from an instance configuration. Use the `sourceDetails` parameter to specify whether a boot volume or an image should be used to launch a new instance. See [LaunchInstanceDetails](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/LaunchInstanceDetails) for more information. * `agent_config` - (Applicable when instance_type=compute) Configuration options for the Oracle Cloud Agent software running on the instance. * `are_all_plugins_disabled` - (Applicable when instance_type=compute) Whether Oracle Cloud Agent can run all the available plugins. This includes the management and monitoring plugins. To get a list of available plugins, use the [ListInstanceagentAvailablePlugins](https://docs.cloud.oracle.com/iaas/api/#/en/instanceagent/20180530/Plugin/ListInstanceagentAvailablePlugins) operation in the Oracle Cloud Agent API. For more information about the available plugins, see [Managing Plugins with Oracle Cloud Agent](https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm). * `is_management_disabled` - (Applicable when instance_type=compute) Whether Oracle Cloud Agent can run all the available management plugins. Default value is false (management plugins are enabled). These are the management plugins: OS Management Service Agent and Compute Instance Run Command. The management plugins are controlled by this parameter and by the per-plugin configuration in the `pluginsConfig` object. * If `isManagementDisabled` is true, all of the management plugins are disabled, regardless of the per-plugin configuration. * If `isManagementDisabled` is false, all of the management plugins are enabled. You can optionally disable individual management plugins by providing a value in the `pluginsConfig` object. * `is_monitoring_disabled` - (Applicable when instance_type=compute) Whether Oracle Cloud Agent can gather performance metrics and monitor the instance using the monitoring plugins. Default value is false (monitoring plugins are enabled). These are the monitoring plugins: Compute Instance Monitoring and Custom Logs Monitoring. * `boot_volume` - (Applicable when instance_type=compute) Boot volume details for the instance. * `is_auto_tune_enabled` - (Applicable when instance_type=compute) Specifies whether the auto-tune performance is enabled for this boot volume. This field is deprecated. Use the `InstanceConfigurationDetachedVolumeAutotunePolicy` instead to enable the volume for detached autotune. * `is_reservations_enabled` - (Applicable when instance_type=compute) Reservations-enabled is a boolean field that allows to enable PR (Persistent Reservation) on a volume. * `kms_key_id` - (Applicable when instance_type=compute) The OCID of the Vault service key to assign as the master encryption key for the volume. * `size_in_gbs` - (Applicable when instance_type=compute) The size of the volume in GBs. * `source_details` - (Applicable when instance_type=compute) * `id` - (Optional) The OCID of the volume backup. * `type` - (Required) The type can be one of these values: `volume`, `volumeBackup` * `vpus_per_gb` - (Applicable when instance_type=compute) The number of volume performance units (VPUs) that will be applied to this volume per GB, representing the Block Volume service's elastic performance options. See [Block Volume Performance Levels](https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/blockvolumeperformance.htm#perf_levels) for more information. Allowed values: * `0`: Represents Lower Cost option. * `10`: Represents Balanced option. * `20`: Represents Higher Performance option. * `30`-`120`: Represents the Ultra High Performance option. For performance autotune enabled volumes, it would be the Default(Minimum) VPUs/GB. * `xrc_kms_key_id` - (Applicable when instance_type=compute) The OCID of the Vault service key which is the master encryption key for the block volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys. For more information about the Vault service and encryption keys, see [Overview of Vault service](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm) and [Using Keys](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Tasks/usingkeys.htm). * `volume_id` - (Applicable when instance_type=compute) The OCID of the volume. ``` -------------------------------- ### Preemptible Instance Configuration Example Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/core_instance_configurations.html.markdown Configure options for preemptible instances, including the action to take upon interruption. The boot volume can be preserved by default. ```json "preemptible_instance_config" : { "preemption_action" : { "preserve_boot_volume" : false, "type" : "TERMINATE" } } ``` -------------------------------- ### Perform a GET request with retryablehttp Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/hashicorp/go-retryablehttp/README.md A simple example demonstrating how to execute a GET request using the retryablehttp package. ```go resp, err := retryablehttp.Get("/foo") if err != nil { panic(err) } ``` -------------------------------- ### LaunchInstanceDetails Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/core_instance_configuration.html.markdown Instance launch details for creating an instance from an instance configuration. Use the `sourceDetails` parameter to specify whether a boot volume or an image should be used to launch a new instance. ```APIDOC ## LaunchInstanceDetails ### Description Instance launch details for creating an instance from an instance configuration. Use the `sourceDetails` parameter to specify whether a boot volume or an image should be used to launch a new instance. See [LaunchInstanceDetails](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/LaunchInstanceDetails) for more information. ### Attributes * `agent_config` - Configuration options for the Oracle Cloud Agent software running on the instance. * `are_all_plugins_disabled` - Whether Oracle Cloud Agent can run all the available plugins. This includes the management and monitoring plugins. To get a list of available plugins, use the [ListInstanceagentAvailablePlugins](https://docs.cloud.oracle.com/iaas/api/#/en/instanceagent/20180530/Plugin/ListInstanceagentAvailablePlugins) operation in the Oracle Cloud Agent API. For more information about the available plugins, see [Managing Plugins with Oracle Cloud Agent](https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm). * `is_management_disabled` - Whether Oracle Cloud Agent can run all the available management plugins. Default value is false (management plugins are enabled). These are the management plugins: OS Management Service Agent and Compute Instance Run Command. ``` -------------------------------- ### GET /managed_instance_installed_packages Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/os_management_hub_managed_instance_installed_packages.html.markdown Retrieves a list of installed packages for a specified managed instance, supporting filters for compartment, display name, and installation date range. ```APIDOC ## GET /managed_instance_installed_packages ### Description Lists the packages that are installed on the specified managed instance. ### Parameters #### Query Parameters - **managed_instance_id** (string) - Required - The OCID of the managed instance. - **compartment_id** (string) - Optional - The OCID of the compartment that contains the resources to list. - **display_name** (string) - Optional - A filter to return resources that match the given display names. - **display_name_contains** (string) - Optional - A filter to return resources that may partially match the given display name. - **time_install_date_end** (string) - Optional - A filter to return only packages that were installed on or before the date provided (ISO 8601). - **time_install_date_start** (string) - Optional - The install date after which to list all packages (ISO 8601). ### Response #### Success Response (200) - **installed_package_collection** (object) - The list of installed packages. - **items** (array) - List of installed packages. - **architecture** (string) - The architecture for which this package was built. - **display_name** (string) - Package name. - **name** (string) - Unique identifier for the package. - **package_classification** (string) - Status of the software package. - **software_sources** (array) - List of software sources that provide the software package. - **time_installed** (string) - The date and time the package was installed. - **time_issued** (string) - The date and time the package was issued. - **type** (string) - Type of the package. - **version** (string) - Version of the installed package. ``` -------------------------------- ### Initialize Go Module Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/vmihailenco/msgpack/v5/README.md Initialize a new Go module before installing the library. ```shell go mod init github.com/my/repo ``` -------------------------------- ### Get Lustre File Storage Available Maintenance Schedule Start Times Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/lustre_file_storage_available_maintenance_schedule_start_times.html.markdown Use this data source to get the list of available maintenance schedule start times. Optional arguments can filter by availability domain, compartment ID, day of the week, or Lustre file system ID. ```hcl data "oci_lustre_file_storage_available_maintenance_schedule_start_times" "test_available_maintenance_schedule_start_times" { #Optional availability_domain = var.available_maintenance_schedule_start_time_availability_domain compartment_id = var.compartment_id day_of_week = var.available_maintenance_schedule_start_time_day_of_week id = var.available_maintenance_schedule_start_time_id } ``` -------------------------------- ### GET /oci_core_cross_connect_locations Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/core_cross_connect_locations.html.markdown Retrieves the list of available FastConnect locations for cross-connect installation. ```APIDOC ## GET /oci_core_cross_connect_locations ### Description Lists the available FastConnect locations for cross-connect installation. This information is required to specify a location when creating a cross-connect. ### Method GET ### Parameters #### Request Body - **compartment_id** (string) - Required - The OCID of the compartment. ### Request Example { "compartment_id": "ocid1.compartment.oc1..example" } ### Response #### Success Response (200) - **cross_connect_locations** (list) - The list of cross_connect_locations. #### Response Example { "cross_connect_locations": [ { "description": "CyrusOne, Chandler, AZ", "name": "CyrusOne, Chandler, AZ" } ] } ``` -------------------------------- ### Get OCI Os Management Hub Managed Instance Group Installed Packages Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/os_management_hub_managed_instance_group_installed_packages.html.markdown Use this data source to retrieve a list of installed packages for a managed instance group. You can filter by compartment, display name, and installation date. ```hcl data "oci_os_management_hub_managed_instance_group_installed_packages" "test_managed_instance_group_installed_packages" { #Required managed_instance_group_id = oci_os_management_hub_managed_instance_group.test_managed_instance_group.id #Optional compartment_id = var.compartment_id display_name = var.managed_instance_group_installed_package_display_name display_name_contains = var.managed_instance_group_installed_package_display_name_contains time_install_date_end = var.managed_instance_group_installed_package_time_install_date_end time_install_date_start = var.managed_instance_group_installed_package_time_install_date_start } ``` -------------------------------- ### hc-install command usage and options Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/hashicorp/hc-install/README.md Displays the command-line interface syntax and available configuration flags for the install command. ```text Usage: hc-install install [options] -version This command installs a HashiCorp product. Options: -version [REQUIRED] Version of product to install. -path Path to directory where the product will be installed. Defaults to current working directory. -log-file Path to file where logs will be written. /dev/stdout or /dev/stderr can be used to log to STDOUT/STDERR. ``` -------------------------------- ### Import Managed Instance Install Windows Updates Management Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/r/os_management_hub_managed_instance_install_windows_updates_management.html.markdown This is an example of how to import an existing Managed Instance Install Windows Updates Management resource into your Terraform configuration. ```bash $ terraform import oci_os_management_hub_managed_instance_install_windows_updates_management.test_managed_instance_install_windows_updates_management "id" ``` -------------------------------- ### Instance Launch Configuration Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/cloud_migrations_target_assets.html.markdown Details on configuring an instance, including shape, shape configuration, and source details for the boot volume or image. ```APIDOC ## POST /iaas/api/instances ### Description Launches a new compute instance with specified configuration. ### Method POST ### Endpoint /iaas/api/instances ### Parameters #### Request Body - **shape** (string) - Required - The shape of an instance. Determines CPU, memory, and other resources. - **shape_config** (object) - Optional - The shape configuration requested for the instance. - **baseline_ocpu_utilization** (string) - Optional - Baseline OCPU utilization for a subcore burstable VM instance. Supported values: `BASELINE_1_8`, `BASELINE_1_2`, `BASELINE_1_1`. - **memory_in_gbs** (number) - Optional - The total amount of memory in gigabytes. - **ocpus** (number) - Optional - The total number of OCPUs available. - **source_details** (object) - Required - Source details for the instance. - **boot_volume_id** (string) - Optional - The OCID of the boot volume. - **boot_volume_size_in_gbs** (number) - Optional - The size of the boot volume in GBs (50-32768). - **boot_volume_vpus_per_gb** (number) - Optional - VPUs per GB for the boot volume. Allowed values: 10, 20, 30-120. - **image_id** (string) - Optional - The OCID of the image. - **kms_key_id** (string) - Optional - The OCID of the key management key for the boot volume. - **source_type** (string) - Required - The source type. Use `image` or `bootVolume`. ### Request Example ```json { "shape": "VM.Standard.E4.Flex", "shape_config": { "ocpus": 2, "memory_in_gbs": 16 }, "source_details": { "source_type": "image", "image_id": "ocid1.image.oc1.phx.aaaaaaaa..." } } ``` ### Response #### Success Response (200) - **id** (string) - The OCID of the instance. - **lifecycle_state** (string) - The current state of the instance. #### Response Example ```json { "id": "ocid1.instance.oc1.phx.aaaaaaaa...", "lifecycle_state": "PROVISIONING" } ``` ``` -------------------------------- ### GET /wlms/wlsDomainServerInstalledPatches Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/wlms_wls_domain_server_installed_patches.html.markdown Retrieves a list of installed patches on a server for a specific WebLogic domain. ```APIDOC ## GET /wlms/wlsDomainServerInstalledPatches ### Description Gets a list of installed patches on a server for a domain. ### Method GET ### Parameters #### Query Parameters - **server_id** (string) - Required - The unique identifier of a server. - **wls_domain_id** (string) - Required - The OCID of the WebLogic domain. ### Response #### Success Response (200) - **installed_patch_collection** (object) - The list of installed_patch_collection. #### Response Example { "installed_patch_collection": { "items": [ { "description": "Patch description", "display_name": "Patch Name", "id": "patch_id" } ] } } ``` -------------------------------- ### GET /managed_instance_available_windows_updates Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/os_management_hub_managed_instance_available_windows_updates.html.markdown Retrieves a list of Windows updates that can be installed on a specified managed instance. ```APIDOC ## GET /managed_instance_available_windows_updates ### Description Returns a list of Windows updates that can be installed on the specified managed instance. ### Method GET ### Parameters #### Query Parameters - **managed_instance_id** (string) - Required - The OCID of the managed instance. - **classification_type** (string) - Optional - A filter to return only packages that match the given update classification type. - **compartment_id** (string) - Optional - The OCID of the compartment that contains the resources to list. - **display_name** (string) - Optional - A filter to return resources that match the given user-friendly name. - **display_name_contains** (string) - Optional - A filter to return resources that may partially match the given display name. - **is_installable** (boolean) - Optional - Indicates if the update can be installed by the OS Management Hub service. - **name** (string) - Optional - A filter based on the unique identifier for the Windows update. ### Response #### Success Response (200) - **available_windows_update_collection** (object) - The list of available_windows_update_collection. - **items** (array) - List of available Windows updates. - **installable** (boolean) - Indicates whether the update can be installed using the service. - **is_reboot_required_for_installation** (boolean) - Indicates whether a reboot is required to complete the installation of this update. - **name** (string) - Name of the Windows update. - **update_id** (string) - Unique identifier for the Windows update. - **update_type** (string) - The type of Windows update. ``` -------------------------------- ### CLI Installation - Homebrew Source: https://github.com/oracle/terraform-provider-oci/blob/master/vendor/github.com/hashicorp/hc-install/README.md Instructions for installing the hc-install CLI using Homebrew. ```APIDOC ## CLI Installation - Homebrew ### Description Install the `hc-install` command-line utility using Homebrew on macOS or Linux. ### Method Shell command ### Endpoint N/A ### Parameters None ### Request Example ```sh brew install hashicorp/tap/hc-install ``` ### Response N/A ``` -------------------------------- ### GET /jms/agentInstallers Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/jms_agent_installers.html.markdown Retrieves a list of agent installer information from the OCI Jms service. ```APIDOC ## GET /jms/agentInstallers ### Description This data source provides the list of Agent Installers in Oracle Cloud Infrastructure Jms service. ### Method GET ### Parameters #### Query Parameters - **compartment_id** (string) - Optional - The OCID of the compartment in which to list resources. - **fleet_id** (string) - Optional - The ID of the Fleet. - **os_family** (string) - Optional - The OS family for the agent installer. - **platform_architecture** (string) - Optional - The platform architecture for the agent installer. ### Response #### Success Response (200) - **agent_installer_collection** (object) - The list of agent_installer_collection. - **items** (array) - A list of the agent installer summaries. - **agent_installer_description** (string) - Description of the agent installer artifact. - **agent_installer_id** (string) - Unique identifier for the agent installer. - **agent_installer_version** (string) - Agent installer version. - **agent_version** (string) - Agent image version. - **approximate_file_size_in_bytes** (integer) - Approximate compressed file size in bytes. - **java_version** (string) - Java version. - **os_family** (string) - The target operating system family. - **package_type** (string) - The package type of the agent software. - **platform_architecture** (string) - The target operating system architecture. - **sha256** (string) - SHA256 checksum of the agent installer. ``` -------------------------------- ### GET /fleet_apps_management/installed_patches Source: https://github.com/oracle/terraform-provider-oci/blob/master/website/docs/d/fleet_apps_management_installed_patches.html.markdown Retrieves a list of installed patches for a specified target within a compartment. ```APIDOC ## GET /fleet_apps_management/installed_patches ### Description Gets a list of installed patches for the specified target in the Oracle Cloud Infrastructure Fleet Apps Management service. ### Parameters #### Query Parameters - **compartment_id** (string) - Required - The OCID of the compartment in which to list resources. - **target_id** (string) - Optional - Target identifier. - **target_name** (string) - Optional - Target name. - **patch_level** (string) - Optional - Patch level with values like LATEST, LATEST_MINUS_ONE, LATEST_MINUS_TWO etc. - **patch_type** (string) - Optional - Patch type. - **severity** (string) - Optional - Patch severity with values like CRITICAL, HIGH, MEDIUM and LOW. ### Response #### Success Response (200) - **installed_patch_collection** (object) - The list of installed_patch_collection. - **items** (array) - List of installed patches - **patch_description** (string) - Description of the patch - **patch_id** (string) - The OCID of the patch - **patch_level** (string) - Patch level - **patch_name** (string) - Name of the patch - **patch_type** (string) - Type of the patch - **severity** (string) - Patch severity - **time_applied** (string) - Date on which the patch was applied to the target - **time_released** (string) - Date on which the patch was released ``` -------------------------------- ### HTTP Replay Installation and Usage Source: https://github.com/oracle/terraform-provider-oci/blob/master/httpreplay/README.md This section details how to install and use the HTTP Replay functionality within the OCI Go SDK. It covers installing the recorder, setting scenarios for recording/replaying, and saving scenario data. ```APIDOC ## HTTP Replay Installation and Usage ### Description This library provides a recording mechanism for the OCI-GO-SDK. It hooks into the 'Transport' layer of the HTTP request, calling through to the real network as needed. You can select the record or replay mode by specifying a build tag to go: `-tags `. Available modes: * bypass (default): Do nothing. * record: Store the Interaction. * replay: Load the Interaction file and send back the response. ### Functions #### InstallRecorder * Installs hooks into the `http.Client` to allow the record/replay library to intercept HTTP calls. `InstallRecorder` tries to be safe if called multiple times, but it is possible to fool it. Best is to only call it once per `http.Client`. ```go if h, ok := client.HTTPClient.(*http.Client); ok { _, err := httpreplay.InstallRecorder(h) if err != nil { return err } } ``` #### SetScenario * Names the scenario that is about to run. Currently, this specifies the filename that the scenario data will be saved into, with a `.yaml` extension. * If `-tags record` is specified, the requests are written to this file in the `SaveScenario` call. The Interaction file will be stored in directory `~/record/` with the name passed into. * If `-tags replay` is specified, then a file by that name is immediately read and used for generating replies to network requests. ```go httpreplay.SetScenario("TestMyServiceResource_basic") ``` #### SaveScenario * Saves the scenario data. Currently, if `-tags record` is specified, this writes all the recorded requests to the file named in `SetScenario`. ```go defer httpreplay.SaveScenario() ``` ### Record Storage * In record mode: After running the test case, the record file will be stored under `oci/record/`. * In replay mode: Look for the record file under `oci/record/` and throw an error if it is not found. ### Example Usage * To run normally: `go test` * To run 1 specific test case: `go test -run ` * To record interactions: `go test -tags record` * To record 1 specific test case: `go test -run -tags record` * To replay interactions: `go test -tags replay` * To replay 1 specific test case: `go test -run -tags replay` ```