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

Feat: support Environment Output configuration type - new resource #886

Merged
merged 17 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions client/configuration_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ const (
type Format string

const (
Text Format = ""
HCL Format = "HCL"
JSON Format = "JSON"
Text Format = ""
HCL Format = "HCL"
JSON Format = "JSON"
ENVIRONMENT_OUTPUT Format = "ENVIRONMENT_OUTPUT"
)

type ConfigurationVariableSchema struct {
Expand Down Expand Up @@ -171,6 +172,7 @@ func getSchema(params ConfigurationVariableCreateParams) map[string]interface{}
if params.Format != Text {
schema["format"] = params.Format
}

return schema
}

Expand Down
111 changes: 56 additions & 55 deletions env0/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,61 +104,62 @@ func Provider(version string) plugin.ProviderFunc {
"env0_module_testing_project": dataModuleTestingProject(),
},
ResourcesMap: map[string]*schema.Resource{
"env0_project": resourceProject(),
"env0_project_policy": resourceProjectPolicy(),
"env0_configuration_variable": resourceConfigurationVariable(),
"env0_template": resourceTemplate(),
"env0_ssh_key": resourceSshKey(),
"env0_aws_credentials": resourceAwsCredentials(),
"env0_aws_oidc_credentials": resourceAwsOidcCredentials(),
"env0_aws_cost_credentials": resourceCostCredentials("aws"),
"env0_azure_credentials": resourceAzureCredentials(),
"env0_azure_cost_credentials": resourceCostCredentials("azure"),
"env0_azure_oidc_credentials": resourceAzureOidcCredentials(),
"env0_gcp_cost_credentials": resourceCostCredentials("google"),
"env0_gcp_credentials": resourceGcpCredentials(),
"env0_gcp_oidc_credentials": resourceGcpOidcCredentials(),
"env0_vault_oidc_credentials": resourceVaultOidcCredentials(),
"env0_template_project_assignment": resourceTemplateProjectAssignment(),
"env0_cloud_credentials_project_assignment": resourceCloudCredentialsProjectAssignment(),
"env0_cost_credentials_project_assignment": resourceCostCredentialsProjectAssignment(),
"env0_team_project_assignment": resourceTeamProjectAssignment(),
"env0_team": resourceTeam(),
"env0_environment": resourceEnvironment(),
"env0_workflow_triggers": resourceWorkflowTriggers(),
"env0_workflow_trigger": resourceWorkflowTrigger(),
"env0_environment_scheduling": resourceEnvironmentScheduling(),
"env0_environment_drift_detection": resourceDriftDetection(),
"env0_notification": resourceNotification(),
"env0_notification_project_assignment": resourceNotificationProjectAssignment(),
"env0_module": resourceModule(),
"env0_git_token": resourceGitToken(),
"env0_api_key": resourceApiKey(),
"env0_organization_policy": resourceOrganizationPolicy(),
"env0_agent_project_assignment": resourceAgentProjectAssignment(),
"env0_user_team_assignment": resourceUserTeamAssignment(),
"env0_user_project_assignment": resourceUserProjectAssignment(),
"env0_custom_role": resourceCustomRole(),
"env0_user_organization_assignment": resourceUserOrganizationAssignment(),
"env0_custom_flow": resourceCustomFlow(),
"env0_custom_flow_assignment": resourceCustomFlowAssignment(),
"env0_environment_state_access": resourceEnvironmentStateAccess(),
"env0_gpg_key": resourceGpgKey(),
"env0_provider": resourceProvider(),
"env0_user_environment_assignment": resourceUserEnvironmentAssignment(),
"env0_team_environment_assignment": resourceTeamEnvironmentAssignment(),
"env0_team_organization_assignment": resourceTeamOrganizationAssignment(),
"env0_approval_policy": resourceApprovalPolicy(),
"env0_approval_policy_assignment": resourceApprovalPolicyAssignment(),
"env0_project_budget": resourceProjectBudget(),
"env0_environment_discovery_configuration": resourceEnvironmentDiscoveryConfiguration(),
"env0_kubeconfig_credentials": resourceKubeconfigCredentials(),
"env0_aws_eks_credentials": resourceAwsEksCredentials(),
"env0_azure_aks_credentials": resourceAzureAksCredentials(),
"env0_gcp_gke_credentials": resourceGcpGkeCredentials(),
"env0_environment_import": resourceEnvironmentImport(),
"env0_variable_set": resourceVariableSet(),
"env0_variable_set_assignment": resourceVariableSetAssignment(),
"env0_project": resourceProject(),
"env0_project_policy": resourceProjectPolicy(),
"env0_configuration_variable": resourceConfigurationVariable(),
"env0_template": resourceTemplate(),
"env0_ssh_key": resourceSshKey(),
"env0_aws_credentials": resourceAwsCredentials(),
"env0_aws_oidc_credentials": resourceAwsOidcCredentials(),
"env0_aws_cost_credentials": resourceCostCredentials("aws"),
"env0_azure_credentials": resourceAzureCredentials(),
"env0_azure_cost_credentials": resourceCostCredentials("azure"),
"env0_azure_oidc_credentials": resourceAzureOidcCredentials(),
"env0_gcp_cost_credentials": resourceCostCredentials("google"),
"env0_gcp_credentials": resourceGcpCredentials(),
"env0_gcp_oidc_credentials": resourceGcpOidcCredentials(),
"env0_vault_oidc_credentials": resourceVaultOidcCredentials(),
"env0_template_project_assignment": resourceTemplateProjectAssignment(),
"env0_cloud_credentials_project_assignment": resourceCloudCredentialsProjectAssignment(),
"env0_cost_credentials_project_assignment": resourceCostCredentialsProjectAssignment(),
"env0_team_project_assignment": resourceTeamProjectAssignment(),
"env0_team": resourceTeam(),
"env0_environment": resourceEnvironment(),
"env0_workflow_triggers": resourceWorkflowTriggers(),
"env0_workflow_trigger": resourceWorkflowTrigger(),
"env0_environment_scheduling": resourceEnvironmentScheduling(),
"env0_environment_drift_detection": resourceDriftDetection(),
"env0_notification": resourceNotification(),
"env0_notification_project_assignment": resourceNotificationProjectAssignment(),
"env0_module": resourceModule(),
"env0_git_token": resourceGitToken(),
"env0_api_key": resourceApiKey(),
"env0_organization_policy": resourceOrganizationPolicy(),
"env0_agent_project_assignment": resourceAgentProjectAssignment(),
"env0_user_team_assignment": resourceUserTeamAssignment(),
"env0_user_project_assignment": resourceUserProjectAssignment(),
"env0_custom_role": resourceCustomRole(),
"env0_user_organization_assignment": resourceUserOrganizationAssignment(),
"env0_custom_flow": resourceCustomFlow(),
"env0_custom_flow_assignment": resourceCustomFlowAssignment(),
"env0_environment_state_access": resourceEnvironmentStateAccess(),
"env0_gpg_key": resourceGpgKey(),
"env0_provider": resourceProvider(),
"env0_user_environment_assignment": resourceUserEnvironmentAssignment(),
"env0_team_environment_assignment": resourceTeamEnvironmentAssignment(),
"env0_team_organization_assignment": resourceTeamOrganizationAssignment(),
"env0_approval_policy": resourceApprovalPolicy(),
"env0_approval_policy_assignment": resourceApprovalPolicyAssignment(),
"env0_project_budget": resourceProjectBudget(),
"env0_environment_discovery_configuration": resourceEnvironmentDiscoveryConfiguration(),
"env0_kubeconfig_credentials": resourceKubeconfigCredentials(),
"env0_aws_eks_credentials": resourceAwsEksCredentials(),
"env0_azure_aks_credentials": resourceAzureAksCredentials(),
"env0_gcp_gke_credentials": resourceGcpGkeCredentials(),
"env0_environment_import": resourceEnvironmentImport(),
"env0_variable_set": resourceVariableSet(),
"env0_variable_set_assignment": resourceVariableSetAssignment(),
"env0_environment_output_configuration_variable": resourceEnvironmentOutputConfigurationVariable(),
},
}

Expand Down
2 changes: 1 addition & 1 deletion env0/resource_configuration_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func resourceConfigurationVariableUpdate(ctx context.Context, d *schema.Resource

func resourceConfigurationVariableDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
// don't delete if soft delete is set
if softDelete := d.Get("soft_delete"); softDelete.(bool) {
if softDelete := d.Get("soft_delete"); softDelete != nil && softDelete.(bool) {
Copy link
Collaborator Author

@TomerHeber TomerHeber Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case soft_delete isn't in the schema...

return nil
}

Expand Down
Loading
Loading