Commit 0dd651f
committed
internal/provider: refactor
This is done to align the schema with the standard provider.
```console
% make testacc PKG_NAME=internal/aws/ec2 TESTARGS='-run=TestAccAWSEC2VPC_providerMeta'
TF_ACC=1 go test ./internal/aws/ec2 -v -count 1 -parallel 20 -run=TestAccAWSEC2VPC_providerMeta -timeout 180m
--- PASS: TestAccAWSEC2VPC_providerMeta (31.37s)
PASS
ok github.com/hashicorp/terraform-provider-awscc/internal/aws/ec2 32.268s
```
```console
% make testacc PKG_NAME=internal/aws/logs TESTARGS='-run=TestAccAWSLogsLogGroup_providerMeta'
TF_ACC=1 go test ./internal/aws/logs -v -count 1 -parallel 20 -run=TestAccAWSLogsLogGroup_providerMeta -timeout 180m
--- PASS: TestAccAWSLogsLogGroup_providerMeta (24.17s)
PASS
ok github.com/hashicorp/terraform-provider-awscc/internal/aws/logs 25.032s
```
Inspecting the CloudTrail event history, we can see the `CreateResource`
event contains the expected User-Agent information appended.
```
"userAgent": "APN/1.0 HashiCorp/1.0 Terraform/1.14.0-beta3 (+https://www.terraform.io) terraform-provider-awscc/dev (+https://registry.terraform.io/providers/hashicorp/awscc) aws-sdk-go-v2/1.41.0 ua/2.1 os/macos lang/go#1.24.11 md/GOOS#darwin md/GOARCH#arm64 api/cloudcontrol#1.29.8 m/n test-module/0.0.1 (test comment) second-test-module/0.0.2 (second test comment)",
```
Once the CloudControl API receives the request, the subsequent
calls made to other AWS services by cloud control will _not_ include the
additional User-Agent details. Instead the `userAgent` field will just
display the following:
```
"userAgent": "cloudformation.amazonaws.com",
```provider_meta.user_agent to list of strings type1 parent 3c3469a commit 0dd651f
File tree
7 files changed
+12
-59
lines changed- docs
- internal
- acctest
- aws/logs/testdata/LogGroup
- providerMetaWithModule/demo-module
- providerMeta
- generic
- provider
- templates
7 files changed
+12
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 249 | + | |
254 | 250 | | |
255 | 251 | | |
256 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 113 | + | |
| 114 | + | |
123 | 115 | | |
124 | 116 | | |
125 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 4 | + | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 5 | + | |
10 | 6 | | |
11 | 7 | | |
12 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
370 | 368 | | |
371 | 369 | | |
372 | 370 | | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | 371 | | |
378 | 372 | | |
379 | 373 | | |
| |||
940 | 934 | | |
941 | 935 | | |
942 | 936 | | |
943 | | - | |
944 | | - | |
| 937 | + | |
| 938 | + | |
945 | 939 | | |
946 | 940 | | |
947 | | - | |
948 | | - | |
949 | | - | |
| 941 | + | |
950 | 942 | | |
951 | 943 | | |
952 | 944 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
| 295 | + | |
| 296 | + | |
313 | 297 | | |
| 298 | + | |
314 | 299 | | |
315 | 300 | | |
316 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 249 | + | |
254 | 250 | | |
255 | 251 | | |
256 | 252 | | |
| |||
0 commit comments