@@ -84,13 +84,15 @@ func TestAcc_ResourceDeploymentHybrid(t *testing.T) {
84
84
IncludeEnvironmentVariables : false ,
85
85
SchedulerAu : 6 ,
86
86
NodePoolId : nodePoolId ,
87
+ DesiredWorkloadIdentity : "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0" ,
87
88
}),
88
89
Check : resource .ComposeTestCheckFunc (
89
90
resource .TestCheckResourceAttr (resourceVar , "description" , utils .TestResourceDescription ),
90
91
resource .TestCheckResourceAttr (resourceVar , "worker_queues.0.name" , "default" ),
91
92
resource .TestCheckResourceAttr (resourceVar , "environment_variables.#" , "0" ),
92
93
resource .TestCheckResourceAttr (resourceVar , "executor" , "CELERY" ),
93
94
resource .TestCheckResourceAttr (resourceVar , "scheduler_au" , "6" ),
95
+ resource .TestCheckResourceAttr (resourceVar , "workload_identity" , "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0" ),
94
96
// Check via API that deployment exists
95
97
testAccCheckDeploymentExistence (t , deploymentName , false , true ),
96
98
),
@@ -194,13 +196,15 @@ func TestAcc_ResourceDeploymentStandard(t *testing.T) {
194
196
SchedulerSize : string (platform .SchedulerMachineNameEXTRALARGE ),
195
197
IncludeEnvironmentVariables : false ,
196
198
WorkerQueuesStr : workerQueuesStr ("" ),
199
+ DesiredWorkloadIdentity : "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0" ,
197
200
}),
198
201
Check : resource .ComposeTestCheckFunc (
199
202
resource .TestCheckResourceAttr (awsResourceVar , "description" , utils .TestResourceDescription ),
200
203
resource .TestCheckResourceAttr (awsResourceVar , "scheduler_size" , string (platform .SchedulerMachineNameEXTRALARGE )),
201
204
resource .TestCheckResourceAttr (awsResourceVar , "worker_queues.0.name" , "default" ),
202
205
resource .TestCheckNoResourceAttr (awsResourceVar , "environment_variables.0.key" ),
203
206
resource .TestCheckResourceAttr (awsResourceVar , "executor" , "CELERY" ),
207
+ resource .TestCheckResourceAttr (awsResourceVar , "workload_identity" , "arn:aws:iam::123456789:role/AirflowS3Logs-clmk2qqia000008mhff3ndjr0" ),
204
208
// Check via API that deployment exists
205
209
testAccCheckDeploymentExistence (t , awsDeploymentName , true , true ),
206
210
),
@@ -722,6 +726,7 @@ type hybridDeploymentInput struct {
722
726
SchedulerAu int
723
727
NodePoolId string
724
728
DuplicateWorkerQueues bool
729
+ DesiredWorkloadIdentity string
725
730
}
726
731
727
732
func hybridDeployment (input hybridDeploymentInput ) string {
@@ -736,6 +741,10 @@ func hybridDeployment(input hybridDeploymentInput) string {
736
741
} else {
737
742
taskPodNodePoolIdStr = fmt .Sprintf (`task_pod_node_pool_id = "%v"` , input .NodePoolId )
738
743
}
744
+ desiredWorkloadIdentityStr := ""
745
+ if input .DesiredWorkloadIdentity != "" {
746
+ desiredWorkloadIdentityStr = input .DesiredWorkloadIdentity
747
+ }
739
748
740
749
return fmt .Sprintf (`
741
750
resource "astro_workspace" "%v_workspace" {
@@ -758,12 +767,13 @@ resource "astro_deployment" "%v" {
758
767
%v
759
768
%v
760
769
%v
770
+ %v
761
771
}
762
772
` ,
763
773
input .Name , input .Name , utils .TestResourceDescription ,
764
774
input .Name , input .Name , utils .TestResourceDescription ,
765
775
input .ClusterId , input .Executor , input .SchedulerAu , input .Name ,
766
- envVarsStr (input .IncludeEnvironmentVariables ), wqStr , taskPodNodePoolIdStr )
776
+ envVarsStr (input .IncludeEnvironmentVariables ), wqStr , taskPodNodePoolIdStr , desiredWorkloadIdentityStr )
767
777
}
768
778
769
779
func developmentDeployment (scalingSpecDeploymentName , scalingSpec string ) string {
@@ -791,6 +801,7 @@ type standardDeploymentInput struct {
791
801
IsDevelopmentMode bool
792
802
ScalingSpec string
793
803
WorkerQueuesStr string
804
+ DesiredWorkloadIdentity string
794
805
}
795
806
796
807
func standardDeployment (input standardDeploymentInput ) string {
@@ -816,6 +827,10 @@ func standardDeployment(input standardDeploymentInput) string {
816
827
scalingSpecStr = input .ScalingSpec
817
828
}
818
829
}
830
+ desiredWorkloadIdentityStr := ""
831
+ if input .DesiredWorkloadIdentity != "" {
832
+ desiredWorkloadIdentityStr = input .DesiredWorkloadIdentity
833
+ }
819
834
return fmt .Sprintf (`
820
835
resource "astro_workspace" "%v_workspace" {
821
836
name = "%s"
@@ -844,10 +859,11 @@ resource "astro_deployment" "%v" {
844
859
%v
845
860
%v
846
861
%v
862
+ %v
847
863
}
848
864
` ,
849
865
input .Name , input .Name , utils .TestResourceDescription , input .Name , input .Name , input .Description , input .Region , input .CloudProvider , input .Executor , input .IsDevelopmentMode , input .SchedulerSize , input .Name ,
850
- envVarsStr (input .IncludeEnvironmentVariables ), input .WorkerQueuesStr , scalingSpecStr )
866
+ envVarsStr (input .IncludeEnvironmentVariables ), input .WorkerQueuesStr , scalingSpecStr , desiredWorkloadIdentityStr )
851
867
}
852
868
853
869
func standardDeploymentWithVariableName (input standardDeploymentInput ) string {
0 commit comments