From e54ba47daf49d7d1833e46c4c6c33f8e534b0e44 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 6 Feb 2025 09:50:09 -0500 Subject: [PATCH 01/19] add workload identity support --- docs/resources/deployment.md | 1 + internal/provider/models/deployment.go | 1 + .../provider/resources/resource_deployment.go | 26 +++++++++++++++++++ internal/provider/schemas/deployment.go | 7 +++++ main.tf | 0 5 files changed, 35 insertions(+) create mode 100644 main.tf diff --git a/docs/resources/deployment.md b/docs/resources/deployment.md index 2f36ef43..2968f8b7 100644 --- a/docs/resources/deployment.md +++ b/docs/resources/deployment.md @@ -164,6 +164,7 @@ resource "astro_deployment" "imported_deployment" { - `cluster_id` (String) Deployment cluster identifier - required for 'HYBRID' and 'DEDICATED' deployments. If changing this value, the deployment will be recreated in the new cluster - `default_task_pod_cpu` (String) Deployment default task pod CPU - required for 'STANDARD' and 'DEDICATED' deployments - `default_task_pod_memory` (String) Deployment default task pod memory - required for 'STANDARD' and 'DEDICATED' deployments +- `desired_workload_identity` (String) Deployment's desired workload identity. The Terraform provider will use this provided workload identity to create the Deployment. If it is not provided the worload identity will be assigned automatically. - `is_development_mode` (Boolean) Deployment development mode - required for 'STANDARD' and 'DEDICATED' deployments. If changing from 'False' to 'True', the deployment will be recreated - `is_high_availability` (Boolean) Deployment high availability - required for 'STANDARD' and 'DEDICATED' deployments - `original_astro_runtime_version` (String) Deployment's original Astro Runtime version. The Terraform provider will use this provided Astro runtime version to create the Deployment. The Astro runtime version can be updated with your Astro project Dockerfile, but if this value is changed, the Deployment will be recreated with this new Astro runtime version. diff --git a/internal/provider/models/deployment.go b/internal/provider/models/deployment.go index ed877f09..20a4382e 100644 --- a/internal/provider/models/deployment.go +++ b/internal/provider/models/deployment.go @@ -49,6 +49,7 @@ type DeploymentResource struct { DesiredDagTarballVersion types.String `tfsdk:"desired_dag_tarball_version"` IsCicdEnforced types.Bool `tfsdk:"is_cicd_enforced"` IsDagDeployEnabled types.Bool `tfsdk:"is_dag_deploy_enabled"` + DesiredWorkloadIdentity types.String `tfsdk:"desired_workload_identity"` WorkloadIdentity types.String `tfsdk:"workload_identity"` ExternalIps types.Set `tfsdk:"external_ips"` OidcIssuerUrl types.String `tfsdk:"oidc_issuer_url"` diff --git a/internal/provider/resources/resource_deployment.go b/internal/provider/resources/resource_deployment.go index 0c66925e..246c2d5d 100644 --- a/internal/provider/resources/resource_deployment.go +++ b/internal/provider/resources/resource_deployment.go @@ -106,6 +106,8 @@ func (r *DeploymentResource) Create( } } + desiredWorkloadIdentity := data.DesiredWorkloadIdentity.ValueString() + switch data.Type.ValueString() { case string(platform.DeploymentTypeSTANDARD): createStandardDeploymentRequest := platform.CreateStandardDeploymentRequest{ @@ -127,6 +129,9 @@ func (r *DeploymentResource) Create( Type: platform.CreateStandardDeploymentRequestTypeSTANDARD, WorkspaceId: data.WorkspaceId.ValueString(), } + if desiredWorkloadIdentity != "" { + createStandardDeploymentRequest.WorkloadIdentity = &desiredWorkloadIdentity + } // contact emails contactEmails, diags := utils.TypesSetToStringSlice(ctx, data.ContactEmails) @@ -187,6 +192,9 @@ func (r *DeploymentResource) Create( Type: platform.CreateDedicatedDeploymentRequestTypeDEDICATED, WorkspaceId: data.WorkspaceId.ValueString(), } + if desiredWorkloadIdentity != "" { + createDedicatedDeploymentRequest.WorkloadIdentity = &desiredWorkloadIdentity + } // contact emails contactEmails, diags := utils.TypesSetToStringSlice(ctx, data.ContactEmails) @@ -246,6 +254,10 @@ func (r *DeploymentResource) Create( WorkspaceId: data.WorkspaceId.ValueString(), } + if desiredWorkloadIdentity != "" { + createHybridDeploymentRequest.WorkloadIdentity = &desiredWorkloadIdentity + } + // contact emails contactEmails, diags := utils.TypesSetToStringSlice(ctx, data.ContactEmails) createHybridDeploymentRequest.ContactEmails = &contactEmails @@ -386,6 +398,8 @@ func (r *DeploymentResource) Update( var updateDeploymentRequest platform.UpdateDeploymentRequest var envVars []platform.DeploymentEnvironmentVariableRequest + desiredWorkloadIdentity := data.DesiredWorkloadIdentity.ValueString() + switch data.Type.ValueString() { case string(platform.DeploymentTypeSTANDARD): updateStandardDeploymentRequest := platform.UpdateStandardDeploymentRequest{ @@ -405,6 +419,10 @@ func (r *DeploymentResource) Update( WorkspaceId: data.WorkspaceId.ValueString(), } + if desiredWorkloadIdentity != "" { + updateStandardDeploymentRequest.WorkloadIdentity = &desiredWorkloadIdentity + } + // contact emails contactEmails, diags := utils.TypesSetToStringSlice(ctx, data.ContactEmails) updateStandardDeploymentRequest.ContactEmails = &contactEmails @@ -463,6 +481,10 @@ func (r *DeploymentResource) Update( WorkspaceId: data.WorkspaceId.ValueString(), } + if desiredWorkloadIdentity != "" { + updateDedicatedDeploymentRequest.WorkloadIdentity = &desiredWorkloadIdentity + } + // contact emails contactEmails, diags := utils.TypesSetToStringSlice(ctx, data.ContactEmails) updateDedicatedDeploymentRequest.ContactEmails = &contactEmails @@ -519,6 +541,10 @@ func (r *DeploymentResource) Update( WorkspaceId: data.WorkspaceId.ValueString(), } + if desiredWorkloadIdentity != "" { + updateHybridDeploymentRequest.WorkloadIdentity = &desiredWorkloadIdentity + } + // contact emails contactEmails, diags := utils.TypesSetToStringSlice(ctx, data.ContactEmails) updateHybridDeploymentRequest.ContactEmails = &contactEmails diff --git a/internal/provider/schemas/deployment.go b/internal/provider/schemas/deployment.go index 7f8ce52c..443b46d6 100644 --- a/internal/provider/schemas/deployment.go +++ b/internal/provider/schemas/deployment.go @@ -195,6 +195,13 @@ func DeploymentResourceSchemaAttributes() map[string]resourceSchema.Attribute { stringplanmodifier.UseStateForUnknown(), }, }, + "desired_workload_identity": resourceSchema.StringAttribute{ + MarkdownDescription: "Deployment's desired workload identity. The Terraform provider will use this provided workload identity to create the Deployment. If it is not provided the worload identity will be assigned automatically.", + Optional: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplaceIfConfigured(), + }, + }, "workload_identity": resourceSchema.StringAttribute{ MarkdownDescription: "Deployment workload identity. This value can be changed via the Astro API if applicable.", Computed: true, diff --git a/main.tf b/main.tf new file mode 100644 index 00000000..e69de29b From 517f4f447d6eedf7aef0573b417e21ec7b198458 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 6 Feb 2025 09:55:34 -0500 Subject: [PATCH 02/19] remove empty file --- main.tf | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 main.tf diff --git a/main.tf b/main.tf deleted file mode 100644 index e69de29b..00000000 From 420471757bb14fce1502e30c7741822deaaac3a9 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 6 Feb 2025 11:05:52 -0500 Subject: [PATCH 03/19] add acc test coverage --- .../resources/resource_deployment_test.go | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index da71c606..d6478f39 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -84,6 +84,7 @@ func TestAcc_ResourceDeploymentHybrid(t *testing.T) { IncludeEnvironmentVariables: false, SchedulerAu: 6, NodePoolId: nodePoolId, + DesiredWorkloadIdentity: "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0", }), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(resourceVar, "description", utils.TestResourceDescription), @@ -91,6 +92,7 @@ func TestAcc_ResourceDeploymentHybrid(t *testing.T) { resource.TestCheckResourceAttr(resourceVar, "environment_variables.#", "0"), resource.TestCheckResourceAttr(resourceVar, "executor", "CELERY"), resource.TestCheckResourceAttr(resourceVar, "scheduler_au", "6"), + resource.TestCheckResourceAttr(resourceVar, "workload_identity", "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0"), // Check via API that deployment exists testAccCheckDeploymentExistence(t, deploymentName, false, true), ), @@ -194,6 +196,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { SchedulerSize: string(platform.SchedulerMachineNameEXTRALARGE), IncludeEnvironmentVariables: false, WorkerQueuesStr: workerQueuesStr(""), + DesiredWorkloadIdentity: "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0", }), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(awsResourceVar, "description", utils.TestResourceDescription), @@ -201,6 +204,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { resource.TestCheckResourceAttr(awsResourceVar, "worker_queues.0.name", "default"), resource.TestCheckNoResourceAttr(awsResourceVar, "environment_variables.0.key"), resource.TestCheckResourceAttr(awsResourceVar, "executor", "CELERY"), + resource.TestCheckResourceAttr(awsResourceVar, "workload_identity", "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0"), // Check via API that deployment exists testAccCheckDeploymentExistence(t, awsDeploymentName, true, true), ), @@ -722,6 +726,7 @@ type hybridDeploymentInput struct { SchedulerAu int NodePoolId string DuplicateWorkerQueues bool + DesiredWorkloadIdentity string } func hybridDeployment(input hybridDeploymentInput) string { @@ -736,6 +741,10 @@ func hybridDeployment(input hybridDeploymentInput) string { } else { taskPodNodePoolIdStr = fmt.Sprintf(`task_pod_node_pool_id = "%v"`, input.NodePoolId) } + desiredWorkloadIdentityStr := "" + if input.DesiredWorkloadIdentity != "" { + desiredWorkloadIdentityStr = input.DesiredWorkloadIdentity + } return fmt.Sprintf(` resource "astro_workspace" "%v_workspace" { @@ -758,12 +767,13 @@ resource "astro_deployment" "%v" { %v %v %v + %v } `, input.Name, input.Name, utils.TestResourceDescription, input.Name, input.Name, utils.TestResourceDescription, input.ClusterId, input.Executor, input.SchedulerAu, input.Name, - envVarsStr(input.IncludeEnvironmentVariables), wqStr, taskPodNodePoolIdStr) + envVarsStr(input.IncludeEnvironmentVariables), wqStr, taskPodNodePoolIdStr, desiredWorkloadIdentityStr) } func developmentDeployment(scalingSpecDeploymentName, scalingSpec string) string { @@ -791,6 +801,7 @@ type standardDeploymentInput struct { IsDevelopmentMode bool ScalingSpec string WorkerQueuesStr string + DesiredWorkloadIdentity string } func standardDeployment(input standardDeploymentInput) string { @@ -816,6 +827,10 @@ func standardDeployment(input standardDeploymentInput) string { scalingSpecStr = input.ScalingSpec } } + desiredWorkloadIdentityStr := "" + if input.DesiredWorkloadIdentity != "" { + desiredWorkloadIdentityStr = input.DesiredWorkloadIdentity + } return fmt.Sprintf(` resource "astro_workspace" "%v_workspace" { name = "%s" @@ -844,10 +859,11 @@ resource "astro_deployment" "%v" { %v %v %v + %v } `, input.Name, input.Name, utils.TestResourceDescription, input.Name, input.Name, input.Description, input.Region, input.CloudProvider, input.Executor, input.IsDevelopmentMode, input.SchedulerSize, input.Name, - envVarsStr(input.IncludeEnvironmentVariables), input.WorkerQueuesStr, scalingSpecStr) + envVarsStr(input.IncludeEnvironmentVariables), input.WorkerQueuesStr, scalingSpecStr, desiredWorkloadIdentityStr) } func standardDeploymentWithVariableName(input standardDeploymentInput) string { From b2ecc1361b0e61cbdf231877ac69140082199877 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 6 Feb 2025 11:08:36 -0500 Subject: [PATCH 04/19] updat example --- docs/resources/deployment.md | 1 + examples/resources/astro_deployment/resource.tf | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/resources/deployment.md b/docs/resources/deployment.md index 2968f8b7..17ee0c5d 100644 --- a/docs/resources/deployment.md +++ b/docs/resources/deployment.md @@ -31,6 +31,7 @@ resource "astro_deployment" "dedicated" { resource_quota_memory = "20Gi" scheduler_size = "SMALL" workspace_id = "clnp86ly5000401ndaga21g81" + desired_workload_identity = "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0" environment_variables = [{ key = "key1" value = "value1" diff --git a/examples/resources/astro_deployment/resource.tf b/examples/resources/astro_deployment/resource.tf index 08940c4c..8b9f7b3a 100644 --- a/examples/resources/astro_deployment/resource.tf +++ b/examples/resources/astro_deployment/resource.tf @@ -16,6 +16,7 @@ resource "astro_deployment" "dedicated" { resource_quota_memory = "20Gi" scheduler_size = "SMALL" workspace_id = "clnp86ly5000401ndaga21g81" + desired_workload_identity = "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0" environment_variables = [{ key = "key1" value = "value1" From 8549c52f42d762da116a4a0c33542c5532800c59 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 6 Feb 2025 14:43:24 -0500 Subject: [PATCH 05/19] add workload ident to import script --- import/import_script.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/import/import_script.go b/import/import_script.go index bb4622b1..9d7c63a3 100644 --- a/import/import_script.go +++ b/import/import_script.go @@ -824,6 +824,12 @@ func generateDeploymentHCL(ctx context.Context, platformClient *platform.ClientW deploymentType := deployment.Type + workloadIdentity := deployment.WorkloadIdentity + workloadIdentityString := "" + if workloadIdentity != nil { + workloadIdentityString = fmt.Sprintf(`workload_identity = "%s"`, workloadIdentity) + } + if *deploymentType == platform.DeploymentTypeDEDICATED { deploymentHCL = fmt.Sprintf(` resource "astro_deployment" "deployment_%s" { @@ -845,6 +851,7 @@ resource "astro_deployment" "deployment_%s" { type = "%s" workspace_id = "%s" %s + %s } `, deployment.Id, @@ -866,6 +873,7 @@ resource "astro_deployment" "deployment_%s" { stringValue((*string)(deploymentType)), deployment.WorkspaceId, workerQueuesString, + workloadIdentityString, ) } else if *deploymentType == platform.DeploymentTypeSTANDARD { deploymentHCL = fmt.Sprintf(` @@ -889,6 +897,7 @@ resource "astro_deployment" "deployment_%s" { type = "%s" workspace_id = "%s" %s + %s } `, deployment.Id, @@ -911,6 +920,7 @@ resource "astro_deployment" "deployment_%s" { stringValue((*string)(deploymentType)), deployment.WorkspaceId, workerQueuesString, + workloadIdentityString, ) } else { log.Printf("Skipping deployment %s: unsupported deployment type %s", deployment.Id, stringValue((*string)(deploymentType))) From c21c50942f9b7aa6a36eee9016c9db0695893ef2 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 6 Feb 2025 14:51:39 -0500 Subject: [PATCH 06/19] fix import script and add dev notes --- CONTRIBUTING.md | 11 +++++++++++ import/import_script.go | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0e92586..5cd7aa67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,6 +66,17 @@ Ensure you have the following installed: export ASTRO_API_TOKEN= ``` +### Setting up the Import script for Local Development + +1. Build the import script from the import directory + ``` + go build import_script.go + ``` +2. Run the import script + ``` + ./import_script -resources deployment -organizationId -host dev -token YOU_API_TOKEN + ``` + ## Making Changes 1. Create a new branch for your changes: diff --git a/import/import_script.go b/import/import_script.go index 9d7c63a3..42517361 100644 --- a/import/import_script.go +++ b/import/import_script.go @@ -827,7 +827,7 @@ func generateDeploymentHCL(ctx context.Context, platformClient *platform.ClientW workloadIdentity := deployment.WorkloadIdentity workloadIdentityString := "" if workloadIdentity != nil { - workloadIdentityString = fmt.Sprintf(`workload_identity = "%s"`, workloadIdentity) + workloadIdentityString = fmt.Sprintf(`workload_identity = "%s"`, *workloadIdentity) } if *deploymentType == platform.DeploymentTypeDEDICATED { From d3ca6f91d9e365c29ca91962ac0a77ea8dda249c Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 6 Feb 2025 17:08:39 -0500 Subject: [PATCH 07/19] fix docs typo --- docs/resources/deployment.md | 2 +- import/import_script.go | 2 +- internal/provider/schemas/deployment.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/resources/deployment.md b/docs/resources/deployment.md index 17ee0c5d..0b6531a8 100644 --- a/docs/resources/deployment.md +++ b/docs/resources/deployment.md @@ -165,7 +165,7 @@ resource "astro_deployment" "imported_deployment" { - `cluster_id` (String) Deployment cluster identifier - required for 'HYBRID' and 'DEDICATED' deployments. If changing this value, the deployment will be recreated in the new cluster - `default_task_pod_cpu` (String) Deployment default task pod CPU - required for 'STANDARD' and 'DEDICATED' deployments - `default_task_pod_memory` (String) Deployment default task pod memory - required for 'STANDARD' and 'DEDICATED' deployments -- `desired_workload_identity` (String) Deployment's desired workload identity. The Terraform provider will use this provided workload identity to create the Deployment. If it is not provided the worload identity will be assigned automatically. +- `desired_workload_identity` (String) Deployment's desired workload identity. The Terraform provider will use this provided workload identity to create the Deployment. If it is not provided the workload identity will be assigned automatically. - `is_development_mode` (Boolean) Deployment development mode - required for 'STANDARD' and 'DEDICATED' deployments. If changing from 'False' to 'True', the deployment will be recreated - `is_high_availability` (Boolean) Deployment high availability - required for 'STANDARD' and 'DEDICATED' deployments - `original_astro_runtime_version` (String) Deployment's original Astro Runtime version. The Terraform provider will use this provided Astro runtime version to create the Deployment. The Astro runtime version can be updated with your Astro project Dockerfile, but if this value is changed, the Deployment will be recreated with this new Astro runtime version. diff --git a/import/import_script.go b/import/import_script.go index 42517361..12ca0d09 100644 --- a/import/import_script.go +++ b/import/import_script.go @@ -827,7 +827,7 @@ func generateDeploymentHCL(ctx context.Context, platformClient *platform.ClientW workloadIdentity := deployment.WorkloadIdentity workloadIdentityString := "" if workloadIdentity != nil { - workloadIdentityString = fmt.Sprintf(`workload_identity = "%s"`, *workloadIdentity) + workloadIdentityString = fmt.Sprintf(`desired_workload_identity = "%s"`, *workloadIdentity) } if *deploymentType == platform.DeploymentTypeDEDICATED { diff --git a/internal/provider/schemas/deployment.go b/internal/provider/schemas/deployment.go index 443b46d6..4fd72656 100644 --- a/internal/provider/schemas/deployment.go +++ b/internal/provider/schemas/deployment.go @@ -196,7 +196,7 @@ func DeploymentResourceSchemaAttributes() map[string]resourceSchema.Attribute { }, }, "desired_workload_identity": resourceSchema.StringAttribute{ - MarkdownDescription: "Deployment's desired workload identity. The Terraform provider will use this provided workload identity to create the Deployment. If it is not provided the worload identity will be assigned automatically.", + MarkdownDescription: "Deployment's desired workload identity. The Terraform provider will use this provided workload identity to create the Deployment. If it is not provided the workload identity will be assigned automatically.", Optional: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.RequiresReplaceIfConfigured(), From 01e8bb25ffd006ef41eee6ca25230b6a460d2d68 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 6 Feb 2025 17:18:06 -0500 Subject: [PATCH 08/19] don't require delete and recreate on change --- internal/provider/schemas/deployment.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/provider/schemas/deployment.go b/internal/provider/schemas/deployment.go index 4fd72656..7385d53b 100644 --- a/internal/provider/schemas/deployment.go +++ b/internal/provider/schemas/deployment.go @@ -198,9 +198,6 @@ func DeploymentResourceSchemaAttributes() map[string]resourceSchema.Attribute { "desired_workload_identity": resourceSchema.StringAttribute{ MarkdownDescription: "Deployment's desired workload identity. The Terraform provider will use this provided workload identity to create the Deployment. If it is not provided the workload identity will be assigned automatically.", Optional: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplaceIfConfigured(), - }, }, "workload_identity": resourceSchema.StringAttribute{ MarkdownDescription: "Deployment workload identity. This value can be changed via the Astro API if applicable.", From a69882ded210a931689dea82fd760390a2eda619 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Fri, 7 Feb 2025 09:04:29 -0500 Subject: [PATCH 09/19] test fix --- internal/provider/resources/resource_deployment_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index d6478f39..e35a7cc5 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -743,7 +743,7 @@ func hybridDeployment(input hybridDeploymentInput) string { } desiredWorkloadIdentityStr := "" if input.DesiredWorkloadIdentity != "" { - desiredWorkloadIdentityStr = input.DesiredWorkloadIdentity + desiredWorkloadIdentityStr = fmt.Sprintf(`desired_workload_identity = "%s"`, input.DesiredWorkloadIdentity) } return fmt.Sprintf(` @@ -829,7 +829,7 @@ func standardDeployment(input standardDeploymentInput) string { } desiredWorkloadIdentityStr := "" if input.DesiredWorkloadIdentity != "" { - desiredWorkloadIdentityStr = input.DesiredWorkloadIdentity + desiredWorkloadIdentityStr = fmt.Sprintf(`desired_workload_identity = "%s"`, input.DesiredWorkloadIdentity) } return fmt.Sprintf(` resource "astro_workspace" "%v_workspace" { From e78107d0ef8b4249846f44c740da7bf6a44c67b6 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Fri, 7 Feb 2025 11:54:59 -0500 Subject: [PATCH 10/19] test fix --- internal/provider/resources/resource_deployment_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index e35a7cc5..00e8a5fc 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -741,10 +741,6 @@ func hybridDeployment(input hybridDeploymentInput) string { } else { taskPodNodePoolIdStr = fmt.Sprintf(`task_pod_node_pool_id = "%v"`, input.NodePoolId) } - desiredWorkloadIdentityStr := "" - if input.DesiredWorkloadIdentity != "" { - desiredWorkloadIdentityStr = fmt.Sprintf(`desired_workload_identity = "%s"`, input.DesiredWorkloadIdentity) - } return fmt.Sprintf(` resource "astro_workspace" "%v_workspace" { @@ -767,13 +763,12 @@ resource "astro_deployment" "%v" { %v %v %v - %v } `, input.Name, input.Name, utils.TestResourceDescription, input.Name, input.Name, utils.TestResourceDescription, input.ClusterId, input.Executor, input.SchedulerAu, input.Name, - envVarsStr(input.IncludeEnvironmentVariables), wqStr, taskPodNodePoolIdStr, desiredWorkloadIdentityStr) + envVarsStr(input.IncludeEnvironmentVariables), wqStr, taskPodNodePoolIdStr) } func developmentDeployment(scalingSpecDeploymentName, scalingSpec string) string { From 136097ce905dabf8a83a915075e362e9daad384e Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Fri, 7 Feb 2025 12:00:05 -0500 Subject: [PATCH 11/19] test fix --- internal/provider/resources/resource_deployment_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index 00e8a5fc..a4cd719a 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -84,7 +84,6 @@ func TestAcc_ResourceDeploymentHybrid(t *testing.T) { IncludeEnvironmentVariables: false, SchedulerAu: 6, NodePoolId: nodePoolId, - DesiredWorkloadIdentity: "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0", }), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(resourceVar, "description", utils.TestResourceDescription), From 75d07c2de3d906f998122636eec97491e2a16af5 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Fri, 7 Feb 2025 19:05:27 -0500 Subject: [PATCH 12/19] test fix --- internal/provider/resources/resource_deployment_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index a4cd719a..1ce1a824 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -203,7 +203,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { resource.TestCheckResourceAttr(awsResourceVar, "worker_queues.0.name", "default"), resource.TestCheckNoResourceAttr(awsResourceVar, "environment_variables.0.key"), resource.TestCheckResourceAttr(awsResourceVar, "executor", "CELERY"), - resource.TestCheckResourceAttr(awsResourceVar, "workload_identity", "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0"), + resource.TestCheckResourceAttr(awsResourceVar, "desired_workload_identity", "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0"), // Check via API that deployment exists testAccCheckDeploymentExistence(t, awsDeploymentName, true, true), ), From c0798448be10626e5c658ae8c5e4f0a315e6f615 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Mon, 10 Feb 2025 10:33:34 -0500 Subject: [PATCH 13/19] test fix --- internal/provider/resources/resource_deployment_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index 1ce1a824..9b470259 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -91,7 +91,6 @@ func TestAcc_ResourceDeploymentHybrid(t *testing.T) { resource.TestCheckResourceAttr(resourceVar, "environment_variables.#", "0"), resource.TestCheckResourceAttr(resourceVar, "executor", "CELERY"), resource.TestCheckResourceAttr(resourceVar, "scheduler_au", "6"), - resource.TestCheckResourceAttr(resourceVar, "workload_identity", "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0"), // Check via API that deployment exists testAccCheckDeploymentExistence(t, deploymentName, false, true), ), From 33c53a6892a5811779656180623823a18cb2ee9c Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Mon, 10 Feb 2025 15:17:51 -0500 Subject: [PATCH 14/19] test fix --- internal/provider/resources/resource_deployment_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index 9b470259..8e6f01a7 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -602,7 +602,7 @@ func TestAcc_ResourceDeploymentStandardScalingSpec(t *testing.T) { ResourceName: scalingSpecResourceVar, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"external_ips", "scaling_status.%", "scaling_status.hibernation_status.%", "scaling_status.hibernation_status.is_hibernating", "scaling_status.hibernation_status.reason"}, + ImportStateVerifyIgnore: []string{"external_ips", "scaling_status.%", "scaling_status.hibernation_status.%", "scaling_status.hibernation_status.is_hibernating", "scaling_status.hibernation_status.reason", "image_version"}, }, }, }) From 557261350addb1feed2f13a1e01aaa1f526157e5 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 13 Feb 2025 16:40:14 -0500 Subject: [PATCH 15/19] run tests against stage --- .github/workflows/testacc.yml | 34 ++++----- docs/resources/cluster.md | 76 ++++++++++---------- examples/resources/astro_cluster/resource.tf | 76 ++++++++++---------- 3 files changed, 93 insertions(+), 93 deletions(-) diff --git a/.github/workflows/testacc.yml b/.github/workflows/testacc.yml index def6d518..01c56120 100644 --- a/.github/workflows/testacc.yml +++ b/.github/workflows/testacc.yml @@ -79,24 +79,24 @@ jobs: echo "SKIP_CLUSTER_RESOURCE_TESTS=$SKIP_TESTS" >> $GITHUB_ENV - env: TF_ACC: "1" - HYBRID_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HYBRID_ORGANIZATION_API_TOKEN }} - HYBRID_ORGANIZATION_ID: clx44v7op01nf01m5iohqjkk6 - HOSTED_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_ORGANIZATION_API_TOKEN }} - HOSTED_ORGANIZATION_ID: clx42kkcm01fo01o06agtmshg - HOSTED_SCIM_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_SCIM_ORGANIZATION_API_TOKEN }} - HOSTED_SCIM_ORGANIZATION_ID: clz3bcmd3003m01qemptnfenp - HYBRID_CLUSTER_ID: clxkqfzvm001d01ncr9rs80si - HYBRID_DRY_RUN_CLUSTER_ID: clxko4djp008601njcuoxt4z5 - HYBRID_NODE_POOL_ID: clxkqfzvm001c01nc1eosyxzg - ASTRO_API_HOST: https://api.astronomer-dev.io + HYBRID_ORGANIZATION_API_TOKEN: ${{ secrets.STAGE_HYBRID_ORGANIZATION_API_TOKEN }} + HYBRID_ORGANIZATION_ID: clx46ca4y061z01jleyku7sr6 + HOSTED_ORGANIZATION_API_TOKEN: ${{ secrets.STAGE_HOSTED_ORGANIZATION_API_TOKEN }} + HOSTED_ORGANIZATION_ID: clx46acvv060e01ilddqlbsmc + HOSTED_SCIM_ORGANIZATION_API_TOKEN: ${{ secrets.STAGE_HOSTED_SCIM_ORGANIZATION_API_TOKEN }} + HOSTED_SCIM_ORGANIZATION_ID: clz3blqb500lh01mtkwu9zk5z + HYBRID_CLUSTER_ID: clxm3xg9e05bl01ixsrhxje4e + HYBRID_DRY_RUN_CLUSTER_ID: clxm3y54805bs01ix5owqhfff + HYBRID_NODE_POOL_ID: clxm3xg9e05bk01ixrqk52cob + ASTRO_API_HOST: https://api.astronomer-stage.io + HOSTED_TEAM_ID: clx486hno068301il306nuhsm + HOSTED_USER_ID: clz3a95hw00j301jj5jfmcgwd + HOSTED_DUMMY_USER_ID: clzawlsb701vv01ikvsqz5mws + HOSTED_DEPLOYMENT_ID: cly6exz4a00zd01k18t5bo1vf + HOSTED_STANDARD_DEPLOYMENT_ID: cm077ee2807g301kpjkqdoc15 + HOSTED_WORKSPACE_ID: clx480rvx068u01j9mp7t7fqh + HOSTED_API_TOKEN_ID: clxm46ged05b301neuucdqwox SKIP_CLUSTER_RESOURCE_TESTS: ${{ env.SKIP_CLUSTER_RESOURCE_TESTS }} - HOSTED_TEAM_ID: clx44rvzr01nc01o06pze6qb7 - HOSTED_USER_ID: clz3a4ymt004x01on8w5ydq8j - HOSTED_DUMMY_USER_ID: clzawipbm00bm01qw98vzzoca - HOSTED_DEPLOYMENT_ID: cm1zkps2a0cv301ph39benet6 - HOSTED_STANDARD_DEPLOYMENT_ID: cm070pg0r00wd01qgnskk0dir - HOSTED_WORKSPACE_ID: clx42sxw501gl01o0gjenthnh - HOSTED_API_TOKEN_ID: clxm4836f00ql01me3nigmcr6 TESTARGS: "-failfast" run: make testacc diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 4c286805..46da739f 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -15,7 +15,7 @@ Cluster resource. If creating multiple clusters, add a delay between each cluste ```terraform resource "astro_cluster" "aws_example" { type = "DEDICATED" - name = "my first aws cluster" + name = "LIOTTA" region = "us-east-1" cloud_provider = "AWS" vpc_subnet_range = "172.20.0.0/20" @@ -27,43 +27,43 @@ resource "astro_cluster" "aws_example" { } } -resource "astro_cluster" "azure_example" { - type = "DEDICATED" - name = "my first azure cluster" - region = "westus2" - cloud_provider = "AZURE" - vpc_subnet_range = "172.20.0.0/19" - workspace_ids = ["clv4wcf6f003u01m3zp7gsvzg"] -} - -resource "astro_cluster" "gcp_example" { - type = "DEDICATED" - name = "my first gcp cluster" - region = "us-central1" - cloud_provider = "GCP" - pod_subnet_range = "172.21.0.0/19" - service_peering_range = "172.23.0.0/20" - service_subnet_range = "172.22.0.0/22" - vpc_subnet_range = "172.20.0.0/22" - workspace_ids = [] -} - -// Import an existing cluster -import { - id = "clozc036j01to01jrlgvuf98d" // ID of the existing cluster - to = astro_cluster.imported_cluster -} -resource "astro_cluster" "imported_cluster" { - type = "DEDICATED" - name = "an existing cluster to import" - region = "us-central1" - cloud_provider = "GCP" - pod_subnet_range = "172.21.0.0/19" - service_peering_range = "172.23.0.0/20" - service_subnet_range = "172.22.0.0/22" - vpc_subnet_range = "172.20.0.0/22" - workspace_ids = [] -} +# resource "astro_cluster" "azure_example" { +# type = "DEDICATED" +# name = "my first azure cluster" +# region = "westus2" +# cloud_provider = "AZURE" +# vpc_subnet_range = "172.20.0.0/19" +# workspace_ids = ["clv4wcf6f003u01m3zp7gsvzg"] +# } +# +# resource "astro_cluster" "gcp_example" { +# type = "DEDICATED" +# name = "my first gcp cluster" +# region = "us-central1" +# cloud_provider = "GCP" +# pod_subnet_range = "172.21.0.0/19" +# service_peering_range = "172.23.0.0/20" +# service_subnet_range = "172.22.0.0/22" +# vpc_subnet_range = "172.20.0.0/22" +# workspace_ids = [] +# } +# +# // Import an existing cluster +# import { +# id = "clozc036j01to01jrlgvuf98d" // ID of the existing cluster +# to = astro_cluster.imported_cluster +# } +# resource "astro_cluster" "imported_cluster" { +# type = "DEDICATED" +# name = "an existing cluster to import" +# region = "us-central1" +# cloud_provider = "GCP" +# pod_subnet_range = "172.21.0.0/19" +# service_peering_range = "172.23.0.0/20" +# service_subnet_range = "172.22.0.0/22" +# vpc_subnet_range = "172.20.0.0/22" +# workspace_ids = [] +# } ``` diff --git a/examples/resources/astro_cluster/resource.tf b/examples/resources/astro_cluster/resource.tf index eeac7c9b..15dc777c 100644 --- a/examples/resources/astro_cluster/resource.tf +++ b/examples/resources/astro_cluster/resource.tf @@ -1,6 +1,6 @@ resource "astro_cluster" "aws_example" { type = "DEDICATED" - name = "my first aws cluster" + name = "LIOTTA" region = "us-east-1" cloud_provider = "AWS" vpc_subnet_range = "172.20.0.0/20" @@ -12,40 +12,40 @@ resource "astro_cluster" "aws_example" { } } -resource "astro_cluster" "azure_example" { - type = "DEDICATED" - name = "my first azure cluster" - region = "westus2" - cloud_provider = "AZURE" - vpc_subnet_range = "172.20.0.0/19" - workspace_ids = ["clv4wcf6f003u01m3zp7gsvzg"] -} - -resource "astro_cluster" "gcp_example" { - type = "DEDICATED" - name = "my first gcp cluster" - region = "us-central1" - cloud_provider = "GCP" - pod_subnet_range = "172.21.0.0/19" - service_peering_range = "172.23.0.0/20" - service_subnet_range = "172.22.0.0/22" - vpc_subnet_range = "172.20.0.0/22" - workspace_ids = [] -} - -// Import an existing cluster -import { - id = "clozc036j01to01jrlgvuf98d" // ID of the existing cluster - to = astro_cluster.imported_cluster -} -resource "astro_cluster" "imported_cluster" { - type = "DEDICATED" - name = "an existing cluster to import" - region = "us-central1" - cloud_provider = "GCP" - pod_subnet_range = "172.21.0.0/19" - service_peering_range = "172.23.0.0/20" - service_subnet_range = "172.22.0.0/22" - vpc_subnet_range = "172.20.0.0/22" - workspace_ids = [] -} \ No newline at end of file +# resource "astro_cluster" "azure_example" { +# type = "DEDICATED" +# name = "my first azure cluster" +# region = "westus2" +# cloud_provider = "AZURE" +# vpc_subnet_range = "172.20.0.0/19" +# workspace_ids = ["clv4wcf6f003u01m3zp7gsvzg"] +# } +# +# resource "astro_cluster" "gcp_example" { +# type = "DEDICATED" +# name = "my first gcp cluster" +# region = "us-central1" +# cloud_provider = "GCP" +# pod_subnet_range = "172.21.0.0/19" +# service_peering_range = "172.23.0.0/20" +# service_subnet_range = "172.22.0.0/22" +# vpc_subnet_range = "172.20.0.0/22" +# workspace_ids = [] +# } +# +# // Import an existing cluster +# import { +# id = "clozc036j01to01jrlgvuf98d" // ID of the existing cluster +# to = astro_cluster.imported_cluster +# } +# resource "astro_cluster" "imported_cluster" { +# type = "DEDICATED" +# name = "an existing cluster to import" +# region = "us-central1" +# cloud_provider = "GCP" +# pod_subnet_range = "172.21.0.0/19" +# service_peering_range = "172.23.0.0/20" +# service_subnet_range = "172.22.0.0/22" +# vpc_subnet_range = "172.20.0.0/22" +# workspace_ids = [] +# } \ No newline at end of file From 7e219be790b86f3106e5087f37404fd199cc04cc Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Thu, 13 Feb 2025 17:28:31 -0500 Subject: [PATCH 16/19] switch to a live deployment --- .github/workflows/testacc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testacc.yml b/.github/workflows/testacc.yml index 01c56120..21c74486 100644 --- a/.github/workflows/testacc.yml +++ b/.github/workflows/testacc.yml @@ -92,7 +92,7 @@ jobs: HOSTED_TEAM_ID: clx486hno068301il306nuhsm HOSTED_USER_ID: clz3a95hw00j301jj5jfmcgwd HOSTED_DUMMY_USER_ID: clzawlsb701vv01ikvsqz5mws - HOSTED_DEPLOYMENT_ID: cly6exz4a00zd01k18t5bo1vf + HOSTED_DEPLOYMENT_ID: clx4825jb068z01j9931ib5gb HOSTED_STANDARD_DEPLOYMENT_ID: cm077ee2807g301kpjkqdoc15 HOSTED_WORKSPACE_ID: clx480rvx068u01j9mp7t7fqh HOSTED_API_TOKEN_ID: clxm46ged05b301neuucdqwox From a306483bfa5f5f6e2211728ce410298ec2b6a64c Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Fri, 14 Feb 2025 11:38:32 -0500 Subject: [PATCH 17/19] try other region --- internal/provider/datasources/data_source_deployments_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/datasources/data_source_deployments_test.go b/internal/provider/datasources/data_source_deployments_test.go index aef1f72e..b8afc6b1 100644 --- a/internal/provider/datasources/data_source_deployments_test.go +++ b/internal/provider/datasources/data_source_deployments_test.go @@ -150,7 +150,7 @@ resource "astro_deployment" "test_deployment_celery" { name = "%v-2" description = "%v" type = "STANDARD" - region = "us-east-1" + region = "us-west-2" cloud_provider = "AWS" contact_emails = [] default_task_pod_cpu = "0.25" From aa4ecf42c34abeb259e7f86b98f758ee0c730389 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Fri, 14 Feb 2025 14:25:51 -0500 Subject: [PATCH 18/19] use use east 4 instead --- .../resources/resource_deployment_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index 8e6f01a7..52e0ebb0 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -150,7 +150,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-1", + Region: "us-east-4", CloudProvider: "AWS", Executor: "CELERY", SchedulerSize: string(platform.SchedulerMachineNameEXTRALARGE), @@ -163,7 +163,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-1", + Region: "us-east-4", CloudProvider: "AWS", Executor: "KUBERNETES", SchedulerSize: string(platform.SchedulerMachineNameSMALL), @@ -172,7 +172,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(awsResourceVar, "name", awsDeploymentName), resource.TestCheckResourceAttr(awsResourceVar, "description", utils.TestResourceDescription), - resource.TestCheckResourceAttr(awsResourceVar, "region", "us-east-1"), + resource.TestCheckResourceAttr(awsResourceVar, "region", "us-east-4"), resource.TestCheckResourceAttr(awsResourceVar, "cloud_provider", "AWS"), resource.TestCheckResourceAttr(awsResourceVar, "executor", "KUBERNETES"), resource.TestCheckNoResourceAttr(awsResourceVar, "worker_queues"), @@ -188,7 +188,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-1", + Region: "us-east-4", CloudProvider: "AWS", Executor: "CELERY", SchedulerSize: string(platform.SchedulerMachineNameEXTRALARGE), @@ -243,7 +243,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-1", + Region: "us-east-4", CloudProvider: "AWS", Executor: "CELERY", SchedulerSize: string(platform.SchedulerMachineNameMEDIUM), @@ -262,7 +262,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-1", + Region: "us-east-4", CloudProvider: "AWS", Executor: "KUBERNETES", SchedulerSize: string(platform.SchedulerMachineNameMEDIUM), @@ -280,7 +280,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-1", + Region: "us-east-4", CloudProvider: "AWS", Executor: "KUBERNETES", SchedulerSize: string(platform.SchedulerMachineNameSMALL), @@ -299,7 +299,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-1", + Region: "us-east-4", CloudProvider: "AWS", Executor: "KUBERNETES", SchedulerSize: string(platform.SchedulerMachineNameSMALL), @@ -614,7 +614,7 @@ func TestAcc_ResourceDeploymentStandardRemovedOutsideOfTerraform(t *testing.T) { depInput := standardDeploymentInput{ Name: standardDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-1", + Region: "us-east-4", CloudProvider: "AWS", Executor: "KUBERNETES", IncludeEnvironmentVariables: true, From aca32f9e8294aae83eb416528057fd54bfdc9221 Mon Sep 17 00:00:00 2001 From: Alex Liotta Date: Fri, 14 Feb 2025 21:46:59 -0500 Subject: [PATCH 19/19] try us-west-2 --- .../resources/resource_deployment_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index 52e0ebb0..a4568eb2 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -150,7 +150,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-4", + Region: "us-west-2", CloudProvider: "AWS", Executor: "CELERY", SchedulerSize: string(platform.SchedulerMachineNameEXTRALARGE), @@ -163,7 +163,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-4", + Region: "us-west-2", CloudProvider: "AWS", Executor: "KUBERNETES", SchedulerSize: string(platform.SchedulerMachineNameSMALL), @@ -172,7 +172,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(awsResourceVar, "name", awsDeploymentName), resource.TestCheckResourceAttr(awsResourceVar, "description", utils.TestResourceDescription), - resource.TestCheckResourceAttr(awsResourceVar, "region", "us-east-4"), + resource.TestCheckResourceAttr(awsResourceVar, "region", "us-west-2"), resource.TestCheckResourceAttr(awsResourceVar, "cloud_provider", "AWS"), resource.TestCheckResourceAttr(awsResourceVar, "executor", "KUBERNETES"), resource.TestCheckNoResourceAttr(awsResourceVar, "worker_queues"), @@ -188,7 +188,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-4", + Region: "us-west-2", CloudProvider: "AWS", Executor: "CELERY", SchedulerSize: string(platform.SchedulerMachineNameEXTRALARGE), @@ -243,7 +243,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-4", + Region: "us-west-2", CloudProvider: "AWS", Executor: "CELERY", SchedulerSize: string(platform.SchedulerMachineNameMEDIUM), @@ -262,7 +262,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-4", + Region: "us-west-2", CloudProvider: "AWS", Executor: "KUBERNETES", SchedulerSize: string(platform.SchedulerMachineNameMEDIUM), @@ -280,7 +280,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-4", + Region: "us-west-2", CloudProvider: "AWS", Executor: "KUBERNETES", SchedulerSize: string(platform.SchedulerMachineNameSMALL), @@ -299,7 +299,7 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) { Config: astronomerprovider.ProviderConfig(t, astronomerprovider.HOSTED) + standardDeployment(standardDeploymentInput{ Name: awsDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-4", + Region: "us-west-2", CloudProvider: "AWS", Executor: "KUBERNETES", SchedulerSize: string(platform.SchedulerMachineNameSMALL), @@ -614,7 +614,7 @@ func TestAcc_ResourceDeploymentStandardRemovedOutsideOfTerraform(t *testing.T) { depInput := standardDeploymentInput{ Name: standardDeploymentName, Description: utils.TestResourceDescription, - Region: "us-east-4", + Region: "us-west-2", CloudProvider: "AWS", Executor: "KUBERNETES", IncludeEnvironmentVariables: true,