-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PCL binding of options.range = number
- Loading branch information
Showing
7 changed files
with
53 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 12 additions & 8 deletions
20
pkg/codegen/testing/test/testdata/simple-range-pp/dotnet/simple-range.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
using System.Collections.Generic; | ||
using Pulumi; | ||
using Aws = Pulumi.Aws; | ||
using Random = Pulumi.Random; | ||
|
||
return await Deployment.RunAsync(() => | ||
{ | ||
var bucket = new List<Aws.S3.Bucket>(); | ||
for (var rangeIndex = 0; rangeIndex < 10; rangeIndex++) | ||
var numbers = new List<Random.RandomInteger>(); | ||
for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++) | ||
{ | ||
var range = new { Value = rangeIndex }; | ||
bucket.Add(new Aws.S3.Bucket($"bucket-{range.Value}", new() | ||
numbers.Add(new Random.RandomInteger($"numbers-{range.Value}", new() | ||
{ | ||
Website = new Aws.S3.Inputs.BucketWebsiteArgs | ||
{ | ||
IndexDocument = $"index-{range.Value}.html", | ||
}, | ||
Min = 1, | ||
Max = range.Value, | ||
Seed = $"seed{range.Value}", | ||
})); | ||
} | ||
return new Dictionary<string, object?> | ||
{ | ||
["first"] = numbers[0].Id, | ||
["second"] = numbers[1].Id, | ||
}; | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 10 additions & 6 deletions
16
pkg/codegen/testing/test/testdata/simple-range-pp/nodejs/simple-range.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import * as aws from "@pulumi/aws"; | ||
import * as random from "@pulumi/random"; | ||
|
||
const bucket: aws.s3.Bucket[] = []; | ||
for (const range = {value: 0}; range.value < 10; range.value++) { | ||
bucket.push(new aws.s3.Bucket(`bucket-${range.value}`, {website: { | ||
indexDocument: `index-${range.value}.html`, | ||
}})); | ||
const numbers: random.RandomInteger[] = []; | ||
for (const range = {value: 0}; range.value < 2; range.value++) { | ||
numbers.push(new random.RandomInteger(`numbers-${range.value}`, { | ||
min: 1, | ||
max: range.value, | ||
seed: `seed${range.value}`, | ||
})); | ||
} | ||
export const first = numbers[0].id; | ||
export const second = numbers[1].id; |
15 changes: 9 additions & 6 deletions
15
pkg/codegen/testing/test/testdata/simple-range-pp/python/simple-range.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import pulumi | ||
import pulumi_aws as aws | ||
import pulumi_random as random | ||
|
||
bucket = [] | ||
for range in [{"value": i} for i in range(0, 10)]: | ||
bucket.append(aws.s3.Bucket(f"bucket-{range['value']}", website=aws.s3.BucketWebsiteArgs( | ||
index_document=f"index-{range['value']}.html", | ||
))) | ||
numbers = [] | ||
for range in [{"value": i} for i in range(0, 2)]: | ||
numbers.append(random.RandomInteger(f"numbers-{range['value']}", | ||
min=1, | ||
max=range["value"], | ||
seed=f"seed{range['value']}")) | ||
pulumi.export("first", numbers[0].id) | ||
pulumi.export("second", numbers[1].id) |
16 changes: 10 additions & 6 deletions
16
pkg/codegen/testing/test/testdata/simple-range-pp/simple-range.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
resource bucket "aws:s3:Bucket" { | ||
resource numbers "random:index/randomInteger:RandomInteger" { | ||
options { | ||
range = 10 | ||
range = 2 | ||
} | ||
website = { | ||
indexDocument = "index-${range.value}.html" | ||
} | ||
} | ||
|
||
min = 1 | ||
max = range.value | ||
seed = "seed${range.value}" | ||
} | ||
|
||
output first { value = numbers[0].id } | ||
output second { value = numbers[1].id } |