diff --git a/.github/actions/acc_test/action.yaml b/.github/actions/acc_test/action.yaml index 26aaf210..1d643ac6 100644 --- a/.github/actions/acc_test/action.yaml +++ b/.github/actions/acc_test/action.yaml @@ -192,7 +192,7 @@ runs: TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \ go test ${{ inputs.test_file }} -count=1 -timeout=30m env: - TF_PROJECT_ID: ${{ inputs.project_id }} + TF_ACC_PROJECT_ID: ${{ inputs.project_id }} TF_ACC_REGION: ${{ inputs.region }} TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ inputs.project_user_email }} TF_ACC_KEK_KEY_ID: ${{ inputs.tf_acc_kek_key_id }} @@ -220,7 +220,7 @@ runs: TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \ go test ./... -count=1 -timeout=30m env: - TF_PROJECT_ID: ${{ inputs.project_id }} + TF_ACC_PROJECT_ID: ${{ inputs.project_id }} TF_ACC_REGION: ${{ inputs.region }} TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ inputs.project_user_email }} TF_ACC_KEK_KEY_ID: ${{ inputs.tf_acc_kek_key_id }} diff --git a/.github/workflows/tf-acc-test.yaml b/.github/workflows/tf-acc-test.yaml index 890c085a..c56056a2 100644 --- a/.github/workflows/tf-acc-test.yaml +++ b/.github/workflows/tf-acc-test.yaml @@ -18,7 +18,7 @@ jobs: uses: ./.github/actions/acc_test with: go-version: ${{ env.GO_VERSION }} - project_id: ${{ vars.TEST_PROJECT_ID }} + project_id: ${{ vars.TF_ACC_PROJECT_ID }} region: 'eu01' service_account_json_content_b64: "${{ secrets.TF_ACC_SERVICE_ACCOUNT_JSON_B64 }}" project_user_email: ${{ vars.TEST_PROJECT_USER_EMAIL }} diff --git a/stackit/internal/services/postgresflexalpha/instance/resource.go b/stackit/internal/services/postgresflexalpha/instance/resource.go index b4bfe2bc..d07bf546 100644 --- a/stackit/internal/services/postgresflexalpha/instance/resource.go +++ b/stackit/internal/services/postgresflexalpha/instance/resource.go @@ -196,9 +196,9 @@ func (r *instanceResource) Create( ctx = core.InitProviderContext(ctx) - projectId := model.ProjectId.ValueString() + projectID := model.ProjectId.ValueString() region := model.Region.ValueString() - ctx = tflog.SetField(ctx, "project_id", projectId) + ctx = tflog.SetField(ctx, "project_id", projectID) ctx = tflog.SetField(ctx, "region", region) var netAcl []string @@ -214,7 +214,7 @@ func (r *instanceResource) Create( // Create new instance createResp, err := r.client.DefaultAPI.CreateInstanceRequest( ctx, - projectId, + projectID, region, ).CreateInstanceRequestPayload(payload).Execute() if err != nil { @@ -231,7 +231,7 @@ func (r *instanceResource) Create( // Set data returned by API in identity identity := InstanceResourceIdentityModel{ - ProjectID: types.StringValue(projectId), + ProjectID: types.StringValue(projectID), Region: types.StringValue(region), InstanceID: types.StringPointerValue(instanceID), } @@ -240,7 +240,7 @@ func (r *instanceResource) Create( return } - waitResp, err := wait.CreateInstanceWaitHandler(ctx, r.client.DefaultAPI, projectId, region, *instanceID). + waitResp, err := wait.CreateInstanceWaitHandler(ctx, r.client.DefaultAPI, projectID, region, *instanceID). WaitWithContext(ctx) if err != nil { core.LogAndAddError( diff --git a/stackit/internal/services/postgresflexalpha/postgresflex_acc_test.go b/stackit/internal/services/postgresflexalpha/postgresflex_acc_test.go index 64b7e901..0b59be64 100644 --- a/stackit/internal/services/postgresflexalpha/postgresflex_acc_test.go +++ b/stackit/internal/services/postgresflexalpha/postgresflex_acc_test.go @@ -297,6 +297,9 @@ func TestAccInstanceWithUsers(t *testing.T) { data := getExample() userName := "testUser" + if pID, ok := os.LookupEnv("TF_ACC_PROJECT_ID"); !ok || pID == "" { + t.Errorf("TF_ACC_PROJECT_ID is not set") + } data.Users = []User{ { Name: userName,