1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-08-08 22:36:41 +02:00

Change AWS_REGION to AWS_DEFAULT_REGION

This commit is contained in:
Lee Brown
2019-08-26 04:07:19 -08:00
parent e756362c15
commit 965f42ef18
12 changed files with 34 additions and 15 deletions

View File

@ -285,7 +285,7 @@ These can also be passed into _cicd_ as command line options.
```bash
export AWS_ACCESS_KEY_ID=XXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXX
export AWS_REGION="us-west-2"
export AWS_DEFAULT_REGION="us-west-2"
export AWS_USE_ROLE=false
```
@ -311,7 +311,7 @@ $ cicd [global options] command [command options] [arguments...]
`--aws-secret-key value`
* AWS Region - optional, can be set via env variable `AWS_REGION`
* AWS Region - optional, can be set via env variable `AWS_DEFAULT_REGION`
`--aws-region value`

View File

@ -174,7 +174,7 @@ func NewServiceContext(serviceName Service, cfg *devdeploy.Config) (*ServiceCont
return []*ecs.KeyValuePair{
ecsKeyValuePair(devdeploy.ENV_KEY_ECS_CLUSTER, srv.AwsEcsCluster.ClusterName),
ecsKeyValuePair(devdeploy.ENV_KEY_ECS_SERVICE, srv.AwsEcsService.ServiceName),
ecsKeyValuePair("AWS_REGION", cfg.AwsCredentials.Region),
ecsKeyValuePair("AWS_DEFAULT_REGION", cfg.AwsCredentials.Region),
ecsKeyValuePair("AWS_USE_ROLE", "true"),
ecsKeyValuePair("AWSLOGS_GROUP", srv.AwsCloudWatchLogGroup.LogGroupName),
ecsKeyValuePair("ECS_ENABLE_CONTAINER_METADATA", "true"),

View File

@ -55,7 +55,7 @@ func main() {
cli.StringFlag{
Name: "aws-region",
Usage: "AWS Region",
EnvVar: "AWS_REGION",
EnvVar: "AWS_DEFAULT_REGION",
Destination: &awsCredentials.Region,
},
cli.BoolFlag{
@ -158,6 +158,23 @@ func main() {
Aliases: []string{"d"},
Usage: "deploy a service or function",
Subcommands: []cli.Command{
{
Name: "infrastructure",
Aliases: []string{"infra"},
Usage: "deploy infrastructure for target environment",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "dry-run",
Usage: "print out the deploy details",
},
},
Action: func(c *cli.Context) error {
targetEnv := c.GlobalString("env")
dryRun := c.Bool("dry-run")
return config.DeployInfrastructureForTargetEnv(log, awsCredentials, targetEnv, dryRun)
},
},
{
Name: "service",
Usage: "deploy a service",