Hi there,
I want to leverage Terraform Cloud in order to start managing a Genesys Cloud Org specific configuration.
What I did:
- Created my Terraform Cloud account
- Successfully bound my Terraform Cloud account with my GitHub account.
- Put a main.tf file and resources.tf to my GitHub repo:
resources.tf looks like this
resource "genesyscloud_tf_export" "include-filter" {
export_as_hcl = true
directory = "./genesyscloud"
log_permission_errors = true
include_state_file = true
include_filter_resources = ["genesyscloud_user"]
}
main.tf looks as follows
terraform {
required_providers {
genesyscloud = {
source = "MyPureCloud/genesyscloud"
version = "1.26.0"
}
}
}
provider "genesyscloud" {
oauthclient_id = ""
oauthclient_secret = ""
aws_region = "eu-central-1"
}
Goal was to do an export of current user configuration and start managing users only via Terraform, hence I have state_file set to enabled.
- The commit on GitHub has triggered the Terraform Cloud Run, which was successfull.
However:
The only state file I got is the following:
{
"version": 4,
"terraform_version": "1.11.1",
"serial": 7,
"lineage": "e3788261-b163-8d54-4307-dfb95ba31daa",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "genesyscloud_tf_export",
"name": "include-filter",
"provider": "provider["registry.terraform.io/mypurecloud/genesyscloud"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"directory": "./genesyscloud",
"enable_flow_depends_on": false,
"exclude_attributes": null,
"exclude_filter_resources": null,
"export_as_hcl": true,
"id": "./genesyscloud",
"include_filter_resources": [
"genesyscloud_user"
],
"include_state_file": true,
"log_permission_errors": true,
"resource_types": null,
"split_files_by_resource": false
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
}
],
"check_results": null
}
If I do the same locally in my machine via CLI an additional directory will be created called "genesyscloud" and there I see the tf.json file and tfstate file where both contain the real resources I want to manage later on.
When doing this via cloud I don't see those.
Where are the tf.json and the genuine tfstate file are supposed to be placed when running terraform via cloud?
Has anyone tried this already?
Maybe I did something wrong......
Look forward to hear from you.
BR,
Mat