Skip to content

Commit 7591cf0

Browse files
committed
adding flag to enable dualstack for config downloader
1 parent c173881 commit 7591cf0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmd/config-downloader/downloader.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,15 @@ func main() {
108108
}()
109109

110110
var region, mode, downloadLocation, outputDir, inputConfig, multiConfig string
111+
var useDualStack bool
111112

112113
flag.StringVar(&mode, "mode", "ec2", "Please provide the mode, i.e. ec2, onPremise, onPrem, auto")
113114
flag.StringVar(&downloadLocation, "download-source", "",
114115
"Download source. Example: \"ssm:my-parameter-store-name\" for an EC2 SSM Parameter Store Name holding your CloudWatch Agent configuration.")
115116
flag.StringVar(&outputDir, "output-dir", "", "Path of output json config directory.")
116117
flag.StringVar(&inputConfig, "config", "", "Please provide the common-config file")
117118
flag.StringVar(&multiConfig, "multi-config", "default", "valid values: default, append, remove")
119+
flag.BoolVar(&useDualStack, "use-dualstack", false, "Use dual-stack endpoints for AWS API calls")
118120
flag.Parse()
119121

120122
cc := commonconfig.New()
@@ -130,6 +132,10 @@ func main() {
130132
}
131133
util.SetProxyEnv(cc.ProxyMap())
132134
util.SetSSLEnv(cc.SSLMap())
135+
136+
if useDualStack {
137+
os.Setenv("AWS_USE_DUALSTACK_ENDPOINT", "true")
138+
}
133139
var errorMessage string
134140
if downloadLocation == "" || outputDir == "" {
135141
var errorMessage string

0 commit comments

Comments
 (0)