oracle.oci.oci_resource_manager_stack_facts – Fetches details about one or multiple Stack resources in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 4.11.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_resource_manager_stack_facts.

New in version 2.9.0: of oracle.oci

Synopsis

  • Fetches details about one or multiple Stack resources in Oracle Cloud Infrastructure

  • Lists stacks according to the specified filter. - If called using the compartment ID, returns all stacks in the specified compartment. - If called using the stack ID, returns the specified stack. (See also GetStack.)

  • If stack_id is specified, the details of a single Stack will be returned.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
compartment_id
string
A filter to return only resources that exist in the compartment, identified by OCID.
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
display_name
string
A filter to return only resources that match the given display name exactly. Use this filter to list a resource by name. Requires `sortBy` set to `DISPLAYNAME`. Alternatively, when you know the resource OCID, use the related Get operation.

aliases: name
lifecycle_state
string
    Choices:
  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
  • FAILED
A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
Allowable values: - CREATING - ACTIVE - DELETING - DELETED - FAILED
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
sort_by
string
    Choices:
  • TIMECREATED
  • DISPLAYNAME
The field to use when sorting returned resources. By default, `TIMECREATED` is ordered descending. By default, `DISPLAYNAME` is ordered ascending. Note that you can sort only on one field.
sort_order
string
    Choices:
  • ASC
  • DESC
The sort order to use when sorting returned resources. Ascending (`ASC`) or descending (`DESC`).
stack_id
string
The OCID of the stack.
Required to get a specific stack.

aliases: id
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm

Examples

- name: Get a specific stack
  oci_resource_manager_stack_facts:
    # required
    stack_id: "ocid1.stack.oc1..xxxxxxEXAMPLExxxxxx"

- name: List stacks
  oci_resource_manager_stack_facts:

    # optional
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    lifecycle_state: CREATING
    display_name: display_name_example
    sort_by: TIMECREATED
    sort_order: ASC

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
stacks
complex
on success
List of Stack resources

Sample:
[{'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'config_source': {'branch_name': 'branch_name_example', 'bucket_name': 'bucket_name_example', 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'config_source_type': 'COMPARTMENT_CONFIG_SOURCE', 'configuration_source_provider_id': 'ocid1.configurationsourceprovider.oc1..xxxxxxEXAMPLExxxxxx', 'namespace': 'namespace_example', 'region': 'us-phoenix-1', 'repository_url': 'repository_url_example', 'services_to_discover': [], 'working_directory': 'working_directory_example'}, 'custom_terraform_provider': {'bucket_name': 'bucket_name_example', 'namespace': 'namespace_example', 'region': 'us-phoenix-1'}, 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'description': 'description_example', 'display_name': 'display_name_example', 'freeform_tags': {'Department': 'Finance'}, 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'is_third_party_provider_experience_enabled': True, 'lifecycle_state': 'CREATING', 'stack_drift_status': 'NOT_CHECKED', 'terraform_version': 'terraform_version_example', 'time_created': '2013-10-20T19:20:30+01:00', 'time_drift_last_checked': '2013-10-20T19:20:30+01:00', 'variables': {}}]
 
compartment_id
string
on success
Unique identifier (OCID) for the compartment where the stack is located.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
 
config_source
complex
on success
Returned for get operation

   
branch_name
string
on success
The name of the branch in the Git repository for the configuration source.

Sample:
branch_name_example
   
bucket_name
string
on success
The name of the bucket that contains the Terraform configuration files. Maximum file size (applies to each file in the bucket): 100 MB. (In a bucket, a file is an object.)

Sample:
bucket_name_example
   
compartment_id
string
on success
The OCID of the compartment to use for creating the stack. The new stack will include definitions for supported resource types in this compartment.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
   
config_source_type
string
on success
The type of configuration source to use for the Terraform configuration.

Sample:
COMPARTMENT_CONFIG_SOURCE
   
configuration_source_provider_id
string
on success
The OCID of the Git configuration source.

Sample:
ocid1.configurationsourceprovider.oc1..xxxxxxEXAMPLExxxxxx
   
namespace
string
on success
The Object Storage namespace that contains the bucket.

Sample:
namespace_example
   
region
string
on success
The region to use for creating the stack. The new stack will include definitions for supported resource types in this region.

Sample:
us-phoenix-1
   
repository_url
string
on success
The URL of the Git repository for the configuration source.

Sample:
repository_url_example
   
services_to_discover
list / elements=string
on success
Filter for services to use with Resource Discovery. For example, "database" limits resource discovery to resource types within the Database service. The specified services must be in scope of the given compartment OCID (tenancy level for root compartment, compartment level otherwise). If not specified, then all services at the scope of the given compartment OCID are used.

   
working_directory
string
on success
File path to the directory to use for running Terraform. If not specified, the root directory is used. Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. For more information about required and recommended file structure, see L(File Structure (Terraform Configurations for Resource Manager),https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure).

Sample:
working_directory_example
 
custom_terraform_provider
complex
on success
Returned for get operation

   
bucket_name
string
on success
The name of the bucket that contains the binary files for the custom Terraform providers. For information about buckets, see Managing Buckets.

Sample:
bucket_name_example
   
namespace
string
on success
The Object Storage namespace that contains the bucket you want. For information about Object Storage namespaces, see Understanding Object Storage Namespaces.

Sample:
namespace_example
   
region
string
on success
The name of the region that contains the bucket you want. For information about regions, see Regions and Availability Domains. Example: `us-phoenix-1`

Sample:
us-phoenix-1
 
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: `{"Operations": {"CostCenter": "42"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
 
description
string
on success
Description of the stack.

Sample:
description_example
 
display_name
string
on success
Human-readable name of the stack.

Sample:
display_name_example
 
freeform_tags
dictionary
on success
Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: `{"Department": "Finance"}`

Sample:
{'Department': 'Finance'}
 
id
string
on success
Unique identifier (OCID) for the stack.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
is_third_party_provider_experience_enabled
boolean
on success
When `true`, the stack sources third-party Terraform providers from Terraform Registry and allows custom providers. For more information about stack sourcing of third-party Terraform providers, see Third-party Provider Configuration.
Returned for get operation

Sample:
True
 
lifecycle_state
string
on success
The current lifecycle state of the stack. For more information about stack lifecycle states in Resource Manager, see Key Concepts.

Sample:
CREATING
 
stack_drift_status
string
on success
Drift status of the stack. Drift refers to differences between the actual (current) state of the stack and the expected (defined) state of the stack.
Returned for get operation

Sample:
NOT_CHECKED
 
terraform_version
string
on success
The version of Terraform specified for the stack. Example: `0.12.x`

Sample:
terraform_version_example
 
time_created
string
on success
The date and time at which the stack was created. Format is defined by RFC3339. Example: `2020-01-25T21:10:29.600Z`

Sample:
2013-10-20T19:20:30+01:00
 
time_drift_last_checked
string
on success
The date and time when the drift detection was last executed. Format is defined by RFC3339. Example: `2020-01-25T21:10:29.600Z`
Returned for get operation

Sample:
2013-10-20T19:20:30+01:00
 
variables
dictionary
on success
Terraform variables associated with this resource. Maximum number of variables supported is 250. The maximum size of each variable, including both name and value, is 8192 bytes. Example: `{"CompartmentId": "compartment-id-value"}`
Returned for get operation



Authors

  • Oracle (@oracle)