diff --git a/.github/actions/rosa-create-cluster/action.yml b/.github/actions/rosa-create-cluster/action.yml index 584636dc..f9c7fc70 100644 --- a/.github/actions/rosa-create-cluster/action.yml +++ b/.github/actions/rosa-create-cluster/action.yml @@ -115,7 +115,12 @@ runs: aws s3api create-bucket --bucket ${{ inputs.s3-backend-bucket }} --region ${{ inputs.aws-region }} --create-bucket-configuration LocationConstraint=${{ inputs.aws-region }} fi - aws s3api put-bucket-policy --bucket ${{ inputs.s3-backend-bucket }} --region ${{ inputs.aws-region }} --policy file://.github/actions/rosa-create-cluster/bucket-policy.json + # Define the path to the bucket policy file + bucket_policy_path=".github/actions/rosa-create-cluster/bucket-policy.json" + + # Replace placeholders in the bucket policy file and apply the policy + sed -i "s|\${{ inputs.s3-backend-bucket }}|${{ inputs.s3-backend-bucket }}|g" "$bucket_policy_path" + aws s3api put-bucket-policy --bucket ${{ inputs.s3-backend-bucket }} --region ${{ inputs.aws-region }} --policy file://$bucket_policy_path - name: Terraform Init shell: bash