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

Support Environment Output configuration type #845

Open
tomer-landesman opened this issue May 6, 2024 · 0 comments
Open

Support Environment Output configuration type #845

tomer-landesman opened this issue May 6, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@tomer-landesman
Copy link
Contributor

tomer-landesman commented May 6, 2024

Is your feature request related to a problem? Please describe.
Users need a way to configure new configuration variable with the Environment Output type

Describe the solution you'd like
create a new resource called env0_environment_output_configuration_variable.

this new resource is a subset of env0_configuration_variable, with modifications

Allowed scopes: Project, Environment, Workflow, Deployment

it should use the following structure

resource `env0_environment_output_configuration_variable` {
	# required 
	name = string 
	output_environment_id = string
	output_sub_environment_alias = string
	output_name = string
	scope_environment_id = string
	scope_project_id = string
	
   #optional
	description = string
	is_read_only = bool
	is_required = bool
	type = 'environment' or 'terraform'
}

some of the required fields are mutually exclusive:
output_environment_id OR output_sub_environment_alias must be provided

scope_environment_id OR scope_project_id must be provided

an example request when output_environment_id is provided on project scope:

	{
  "scopeId": "6b1b0897-5322-48cd-98b7-5e11766f54c8",
  "projectId": "6b1b0897-5322-48cd-98b7-5e11766f54c8",
  "schema": {
    "type": "string",
    "format": "ENVIRONMENT_OUTPUT"
  },
  "isRequired": false,
  "isSensitive": false,
  "createdAt": "2024-05-01T11:19:51.091Z",
  "scope": "PROJECT",
  "name": "lala",
  "value": "{\"environmentId\":\"d5a18b6c-db18-4b0c-ae16-8089402d471a\",\"outputName\":\"bool\"}",
  "organizationId": "bd12a04a-b051-4f51-9a8a-8a32ac198802",
  "userId": "google-oauth2|108915661606437380673",
  "updatedAt": "2024-05-06T10:39:35.806Z",
  "id": "c60b9a7c-b1c9-4372-ac1b-4b854fe518da",
  "isReadonly": false,
  "type": 1,
  "overwrites": null
}

an example request when output_sub_environment_alias is provided on workflow deployment scope:

{
  "name": "lala",
  "value": "{\"subEnvironmentAlias\":\"alias1\",\"outputName\":\"my-stuff\"}",
  "description": "",
  "isSensitive": false,
  "isRequired": false,
  "isReadonly": false,
  "regex": "",
  "projectId": "6b1b0897-5322-48cd-98b7-5e11766f54c8",
  "schema": {
    "type": "string",
    "format": "ENVIRONMENT_OUTPUT"
  },
  "createdAt": "2024-05-01T11:19:51.091Z",
  "scope": "ENVIRONMENT",
  "organizationId": "bd12a04a-b051-4f51-9a8a-8a32ac198802",
  "userId": "google-oauth2|108915661606437380673",
  "updatedAt": "2024-05-06T10:39:35.806Z",
  "type": 1,
}

note that as same as regular configuration variable, it can be also provided via a block on the environment resource

the API should be the exact same as configuration variables, but adapted to match the above examples

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
Status: To do
Development

No branches or pull requests

2 participants