Skip to content

Commit 544b662

Browse files
Fix incorrect example for Vpclattice ResourceConfiguration (#5221)
Fixes ##5217 **Add doc edits rule** - **make schema and build SDKs**
1 parent 09ae951 commit 544b662

File tree

7 files changed

+41
-1
lines changed

7 files changed

+41
-1
lines changed

provider/cmd/pulumi-resource-aws/schema.json

+1-1
Large diffs are not rendered by default.

provider/doc_edits.go

+34
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func editRules(defaults []tfbridge.DocsEdit) []tfbridge.DocsEdit {
2929
fixUpCloudFrontPublicKey,
3030
fixUpEcsServiceName,
3131
fixUpBucketReplicationConfig,
32+
fixUpVpclatticeResourceconfigurationExample,
3233
// This fixes up strings such as:
3334
//
3435
// name = "terraform-kinesis-firehose-os",
@@ -232,6 +233,39 @@ var fixUpBucketReplicationConfig = tfbridge.DocsEdit{
232233
},
233234
}
234235

236+
var fixUpVpclatticeResourceconfigurationExample = tfbridge.DocsEdit{
237+
Path: "vpclattice_resource_configuration.html.markdown",
238+
Edit: func(path string, content []byte) ([]byte, error) {
239+
fromBytes := []byte(`port_ranges = ["80"]
240+
241+
resource_configuration_definition {
242+
ip_resource {
243+
ip_address = "10.0.0.1"
244+
}
245+
}`)
246+
toBytes := []byte(`port_ranges = ["80"]
247+
248+
protocol="TCP"
249+
resource_configuration_definition {
250+
ip_resource {
251+
ip_address = "10.0.0.1"
252+
}
253+
}`)
254+
if bytes.Contains(content, fromBytes) {
255+
content = bytes.ReplaceAll(
256+
content,
257+
fromBytes,
258+
toBytes)
259+
} else {
260+
// Hard error to ensure we keep this content up to date
261+
return nil, fmt.Errorf("could not find text in upstream %s, "+
262+
"please verify replace content in doc_edits.go: %s", path, string(fromBytes),
263+
)
264+
}
265+
return content, nil
266+
},
267+
}
268+
235269
func reReplace(from string, to string) tfbridge.DocsEdit {
236270
fromR, toB := regexp.MustCompile(from), []byte(to)
237271
return tfbridge.DocsEdit{

sdk/dotnet/VpcLattice/ResourceConfiguration.cs

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/go/aws/vpclattice/resourceConfiguration.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/java/src/main/java/com/pulumi/aws/vpclattice/ResourceConfiguration.java

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/nodejs/vpclattice/resourceConfiguration.ts

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/python/pulumi_aws/vpclattice/resource_configuration.py

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)