Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit 36660d4

Browse files
committed
Removed strict region checking
1 parent f2fd8fb commit 36660d4

File tree

5 files changed

+20
-33
lines changed

5 files changed

+20
-33
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
bin
33
fargate
44
dist
5+
fargatecli
56
vendor

acm/certificate.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ func (acm SDKClient) ImportCertificate(certificate, privateKey, certificateChain
151151
}
152152

153153
resp, err := acm.client.ImportCertificate(input)
154+
if err != nil {
155+
return "", err
156+
}
154157

155-
return aws.StringValue(resp.CertificateArn), err
158+
return aws.StringValue(resp.CertificateArn), nil
156159
}
157160

158161
// InflateCertificate uses a partially hydrated certificate to fetch the rest of its details and

cmd/root.go

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
)
1818

1919
const (
20-
version = "0.3.0"
20+
version = "0.3.2"
2121

2222
defaultClusterName = "fargate"
2323
defaultRegion = "us-east-1"
@@ -45,23 +45,6 @@ CPU (CPU Units) Memory (MiB)
4545
4096 8192 through 30720 in 1GiB increments
4646
`)
4747

48-
var validRegions = []string{
49-
"ap-east-1",
50-
"ap-northeast-1",
51-
"ap-northeast-2",
52-
"ap-south-1",
53-
"ap-southeast-1",
54-
"ap-southeast-2",
55-
"ca-central-1",
56-
"eu-central-1",
57-
"eu-west-1",
58-
"eu-west-2",
59-
"us-east-1",
60-
"us-east-2",
61-
"us-west-1",
62-
"us-west-2",
63-
}
64-
6548
var (
6649
clusterName string
6750
noColor bool
@@ -124,17 +107,6 @@ CloudWatch Logs, and Amazon Route 53 into an easy-to-use CLI.`,
124107
}
125108
}
126109

127-
var foundRegion bool = false
128-
for _, validRegion := range validRegions {
129-
if region == validRegion {
130-
foundRegion = true
131-
break
132-
}
133-
}
134-
if !foundRegion {
135-
console.IssueExit("Invalid region: %s [valid regions: %s]", region, strings.Join(validRegions, ", "))
136-
}
137-
138110
config := &aws.Config{
139111
Region: aws.String(region),
140112
}

ecs/cluster.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ func (ecs *ECS) CreateCluster() (string, error) {
1111
}
1212

1313
resp, err := ecs.svc.CreateCluster(input)
14+
if err != nil {
15+
return "", err
16+
}
1417

15-
return aws.StringValue(resp.Cluster.ClusterArn), err
18+
return aws.StringValue(resp.Cluster.ClusterArn), nil
1619
}

route53/hosted_zone.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ func (route53 SDKClient) CreateResourceRecord(i CreateResourceRecordInput) (stri
7979
},
8080
)
8181

82-
return aws.StringValue(resp.ChangeInfo.Id), err
82+
if err != nil {
83+
return "", err
84+
}
85+
86+
return aws.StringValue(resp.ChangeInfo.Id), nil
8387
}
8488

8589
// CreateAlias creates an alias record in an Amazon Route 53 hosted zone.
@@ -106,7 +110,11 @@ func (route53 SDKClient) CreateAlias(i CreateAliasInput) (string, error) {
106110
},
107111
)
108112

109-
return aws.StringValue(resp.ChangeInfo.Id), err
113+
if err != nil {
114+
return "", err
115+
}
116+
117+
return aws.StringValue(resp.ChangeInfo.Id), nil
110118
}
111119

112120
// ListHostedZones returns all Amazon Route 53 zones in the caller's account.

0 commit comments

Comments
 (0)