Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to create subaccout API token with the logzio_subaccount resource #165

Open
michelmorin opened this issue Jul 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@michelmorin
Copy link

To add option to create a subaccount API token and have it available as an output when creating a sub account so we can reference later in other terraform apply as provider api token to make terraform changes on sub account such as the logzio_archive_logs on sub Acount

This property should also have the option to give the API token a name.

Currently we do this by calling curl to the Logzio API directly
resource "shell_script" "create_subaccount_api" {
depends_on = [
logzio_subaccount.subaccount
]

lifecycle_commands {
create = <<SCRIPT
curl -X POST "${var.logzio_api_uri}/v1/api-tokens/sub-account" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: ${var.master_api_token}" -d "{ "name": "Default API Token", "accountId":${logzio_subaccount.subaccount.account_id}}"
SCRIPT

delete = <<SCRIPT
  echo "There is no API to destroy the API token."
SCRIPT

}
}

@8naama 8naama added the enhancement New feature or request label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants