Skip to content

Commit

Permalink
Merge pull request #34358 from hashicorp/b-proxy-settings
Browse files Browse the repository at this point in the history
provider: Adds support for `https_proxy` and `no_proxy`
  • Loading branch information
gdavison authored Nov 16, 2023
2 parents aad799a + b523b1c commit b714be9
Show file tree
Hide file tree
Showing 11 changed files with 710 additions and 134 deletions.
3 changes: 3 additions & 0 deletions .changelog/34243.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
provider: Adds `https_proxy` and `no_proxy` parameters.
```
20 changes: 10 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ require (
github.com/gertd/go-pluralize v0.2.1
github.com/google/go-cmp v0.6.0
github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.21.0
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.39
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.40
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.41
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.42
github.com/hashicorp/awspolicyequivalence v1.6.0
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637
Expand Down Expand Up @@ -131,13 +131,13 @@ require (
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.15.2 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.16.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.4.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.2 // indirect
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.0 // indirect
github.com/aws/aws-sdk-go-v2/service/iam v1.27.0 // indirect
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.1 // indirect
github.com/aws/aws-sdk-go-v2/service/iam v1.27.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.8.2 // indirect
Expand All @@ -153,7 +153,7 @@ require (
github.com/evanphx/json-patch v0.5.2 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/frankban/quicktest v1.14.6 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-test/deep v1.1.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand Down Expand Up @@ -186,10 +186,10 @@ require (
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.45.0 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.46.0 // indirect
go.opentelemetry.io/otel v1.20.0 // indirect
go.opentelemetry.io/otel/metric v1.20.0 // indirect
go.opentelemetry.io/otel/trace v1.20.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.14.0 // indirect
Expand Down
40 changes: 20 additions & 20 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 h1:hHgLiIrTRtddC0AK
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0/go.mod h1:w4I/v3NOWgD+qvs1NPEwhd++1h3XPHFaVxasfY6HlYQ=
github.com/aws/aws-sdk-go-v2/config v1.20.0 h1:q2+/mqFhY0J9m3Tb5RGFE3R4sdaUkIe4k2EuDfE3c08=
github.com/aws/aws-sdk-go-v2/config v1.20.0/go.mod h1:7+1riCZXyT+sAGvneR5j+Zl1GyfbBUNQurpQTE6FP6k=
github.com/aws/aws-sdk-go-v2/credentials v1.15.2 h1:rKH7khRMxPdD0u3dHecd0Q7NOVw3EUe7AqdkUOkiOGI=
github.com/aws/aws-sdk-go-v2/credentials v1.15.2/go.mod h1:tXM8wmaeAhfC7nZoCxb0FzM/aRaB1m1WQ7x0qlBLq80=
github.com/aws/aws-sdk-go-v2/credentials v1.16.0 h1:sSEHkXonpZBSPcyUBDRlZjxOi14qM/UK7/vfKhGwmTo=
github.com/aws/aws-sdk-go-v2/credentials v1.16.0/go.mod h1:tXM8wmaeAhfC7nZoCxb0FzM/aRaB1m1WQ7x0qlBLq80=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3 h1:G5KawTAkyHH6WyKQCdHiW4h3PmAXNJpOgwKg3H7sDRE=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3/go.mod h1:hugKmSFnZB+HgNI1sYGT14BUPZkO6alC/e0AWu+0IAQ=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.2 h1:XmPqt2VLMB7dfZ/cGNXBJOFq+Q+VsnEcPW3MqyKAsvY=
Expand Down Expand Up @@ -82,8 +82,8 @@ github.com/aws/aws-sdk-go-v2/service/directoryservice v1.21.1 h1:Ibo5MkTPTIOZSn6
github.com/aws/aws-sdk-go-v2/service/directoryservice v1.21.1/go.mod h1:kPYABdLUg/Id3MJZMRuPbepH8VXtGZbZD2mW6gM1kS4=
github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.5.1 h1:XZPm4jWpwYfcZaGWvy2RKWRpQoMAE9Obl7uAXAja8v8=
github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.5.1/go.mod h1:noDiEWaeR2TLA5R4s7SLp27p7HMMKeTltkvLN/fl0lM=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.0 h1:wAG9NailFhGhg8Ngg2YeCtzGmFWc63SYqJKdvN5ZMkE=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.0/go.mod h1:ByrosnNlEq6xkA0d+FwB4f0HH/5KWCcgBqVxAt+Rsps=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.1 h1:bqSGIS7Nk5EfMKTNDgtaukJQzjOE3LV5Bdz6lRrTsXA=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.25.1/go.mod h1:Fe7bvO6LxNp6WA6y5VmbgW9RRu+g0RlCXpFAmtcHfQs=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.133.0 h1:g4qMdFWe9UVMI6PKytU8BBfW7v80dCMdEnLqc8lIDxw=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.133.0/go.mod h1:NOPsghjhZRkrVvKIxrDrEL7zhVIFYJsHqdeol50Eodk=
github.com/aws/aws-sdk-go-v2/service/eks v1.33.0 h1:6a7enmqn5ehMT6WBCnc/Bq4UAEtiZ1/3OXDVr09NWUM=
Expand All @@ -98,8 +98,8 @@ github.com/aws/aws-sdk-go-v2/service/glacier v1.18.1 h1:wa9rRTfCZw+RvQJuD/4iPn1r
github.com/aws/aws-sdk-go-v2/service/glacier v1.18.1/go.mod h1:ZJhKms6QZ9tiRXtrnMeGgUvbIfBOND/3jpDN7aT+6SQ=
github.com/aws/aws-sdk-go-v2/service/healthlake v1.19.1 h1:31Iepf9WjG+A7yn8PlfD9iPzeRTDti7u4xEX627a4ZQ=
github.com/aws/aws-sdk-go-v2/service/healthlake v1.19.1/go.mod h1:GblRjVXDixg+NQjMQR9gRcBsQRtG3YMcUGeXhwWG6yI=
github.com/aws/aws-sdk-go-v2/service/iam v1.27.0 h1:Yho1UMoY/Gno30by4l7dXgIdr78t4OuIpw3VT1xz/zE=
github.com/aws/aws-sdk-go-v2/service/iam v1.27.0/go.mod h1:K+kpOBBIGJKPAVdyzzCRR6ssqxpVG6SioxWi2/uWctk=
github.com/aws/aws-sdk-go-v2/service/iam v1.27.1 h1:rPkEOnwPOVop34lpAlA4Dv6x67Ys3moXkPDvBfjgSSo=
github.com/aws/aws-sdk-go-v2/service/iam v1.27.1/go.mod h1:qdQ8NUrhmXE80S54w+LrtHUY+1Fp7cQSRZbJUZKrAcU=
github.com/aws/aws-sdk-go-v2/service/identitystore v1.20.1 h1:6Rff8OESjgxil0ynygZdfXFxQuhHKpALtmpdJQ7YyLY=
github.com/aws/aws-sdk-go-v2/service/identitystore v1.20.1/go.mod h1:Esf9ujGNJ5wpXL0Xc9cBEab3Svp7ZoejlawyQ/AbW1c=
github.com/aws/aws-sdk-go-v2/service/inspector2 v1.19.1 h1:H2hwmUz/njU3nJmOFYr5SEZoRX11SFbgysLQ+rea7QI=
Expand Down Expand Up @@ -244,8 +244,8 @@ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66D
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
github.com/go-git/go-git/v5 v5.9.0 h1:cD9SFA7sHVRdJ7AYck1ZaAa/yeuBvGPxwXDL8cxrObY=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg=
Expand All @@ -267,10 +267,10 @@ github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.21.0 h1:IUypt/TbXiJBkBbE3926CgnjD8IltAitdn7Yive61DY=
github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.21.0/go.mod h1:cdTE6F2pCKQobug+RqRaQp7Kz9hIEqiSvpPmb6E5G1w=
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.39 h1:nyCyZVZJ5CmYelTkCDmC9dO2UgzTB5daeAFn8P9UOtA=
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.39/go.mod h1:HMcr0msfsuDQCed/AhmdLlRU0IoAcB31hrvQed3JiLc=
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.40 h1:FLwvItnCr/cu93ZcFdk+eX6AdEpkerbZHMb0ApHfTSM=
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.40/go.mod h1:BKUjqbpcP+tx0HGno7pGrIEyo2xidvM10VZk23EtcP8=
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.41 h1:aaXk20kHudR40hpl/4qoM57lgEW0JAV1l1Cw547G2wE=
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.41/go.mod h1:mN+jBRwrTsDaeBDROT/LVpOtGbX1SFLdZuL+/U4EGGA=
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.42 h1:Y4N+IDb/M/2wubuTnSrGlHQMHWiiWWS6PgATXZFLGoE=
github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 v2.0.0-beta.42/go.mod h1:AZJcpDzBh2Wsfwv2MYTTreac7VQKpcvekxHWKWr/MZo=
github.com/hashicorp/awspolicyequivalence v1.6.0 h1:7aadmkalbc5ewStC6g3rljx1iNvP4QyAhg2KsHx8bU8=
github.com/hashicorp/awspolicyequivalence v1.6.0/go.mod h1:9IOaIHx+a7C0NfUNk1A93M7kHd5rJ19aoUx37LZGC14=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
Expand Down Expand Up @@ -430,14 +430,14 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA=
github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.45.0 h1:IheWOjAlqLJB0oRsfy640dvUy4T5ARTohgUKR23705U=
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.45.0/go.mod h1:uJGvUG+4OT1N41mbAgng0iNdOTvv9chnfavACM2z2DA=
go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs=
go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY=
go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE=
go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8=
go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg=
go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo=
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.46.0 h1:qmQcwJOEOfNvVOD8H7bVAEipp+6UtnDK3qHGCcjwB9o=
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.46.0/go.mod h1:d1FGIeeryqx0a2Oa5oQrK1Ug85AGfFUx+nMtoAwJ4VI=
go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc=
go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs=
go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA=
go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM=
go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ=
go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down
9 changes: 7 additions & 2 deletions internal/conns/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ type Config struct {
EC2MetadataServiceEndpointMode string
Endpoints map[string]string
ForbiddenAccountIds []string
HTTPProxy string
HTTPProxy *string
HTTPSProxy *string
IgnoreTagsConfig *tftags.IgnoreConfig
Insecure bool
MaxRetries int
NoProxy string
Profile string
Region string
RetryMode aws_sdkv2.RetryMode
Expand Down Expand Up @@ -77,8 +79,11 @@ func (c *Config) ConfigureProvider(ctx context.Context, client *AWSClient) (*AWS
Insecure: c.Insecure,
HTTPClient: client.HTTPClient(),
HTTPProxy: c.HTTPProxy,
HTTPSProxy: c.HTTPSProxy,
HTTPProxyMode: awsbase.HTTPProxyModeLegacy,
Logger: logger,
MaxRetries: c.MaxRetries,
NoProxy: c.NoProxy,
Profile: c.Profile,
Region: c.Region,
RetryMode: c.RetryMode,
Expand Down Expand Up @@ -167,7 +172,7 @@ func (c *Config) ConfigureProvider(ctx context.Context, client *AWSClient) (*AWS
for _, d := range awsDiags {
diags = append(diags, diag.Diagnostic{
Severity: baseSeverityToSdkSeverity(d.Severity()),
Summary: fmt.Sprintf("retrieving AWS account details: %s", d.Summary()),
Summary: fmt.Sprintf("Retrieving AWS account details: %s", d.Summary()),
Detail: d.Detail(),
})
}
Expand Down
Loading

0 comments on commit b714be9

Please sign in to comment.