microsoft / azure-pipelines-terraform

Azure Pipelines tasks for installing Terraform and running Terraform commands in a build or release pipeline.
MIT License
101 stars 62 forks source link

AWS backend configuration - static region code :/ #72

Open jeferson-cleancloud opened 2 years ago

jeferson-cleancloud commented 2 years ago

Currently the setup of AWS backendConfig region is only possible via ServiceConnection :/

Based on TerraformCommandHandlerAWS.ts :

    private setupBackend(backendServiceName: string) {
        this.backendConfig.set('bucket', tasks.getInput("backendAWSBucketName", true));
        this.backendConfig.set('key', tasks.getInput("backendAWSKey", true));
        this.backendConfig.set('region', tasks.getEndpointAuthorizationParameter(backendServiceName, "region", true));
        this.backendConfig.set('access_key', tasks.getEndpointAuthorizationParameter(backendServiceName, "username", true));
        this.backendConfig.set('secret_key', tasks.getEndpointAuthorizationParameter(backendServiceName, "password", true));
    }

Would be possible to include a dynamic configuration via task input, such as "backendAWSRegion"?

mericstam commented 2 years ago

I will add this to our internal task board

jeferson-cleancloud commented 2 years ago

Tks much