Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
11002: Reimplement #10984 r=AaronFriel a=AaronFriel This is a rebase and squash of #10984 with an additional commit added to satisfy `make lint` and revert a few changes to methods to use value receivers, where the original PR altered marshaling/unmarshaling behavior. 11031: prepare for next release (v3.43.1) r=AaronFriel a=pulumi-bot 11059: (pulumi-bot) Synced file(s) with pulumi/pulumi-yaml r=aq17 a=pulumi-bot Synced local file(s) with [pulumi/pulumi-yaml](https://github.com/pulumi/pulumi-yaml). This PR syncs changes to the codegen'd PCL files from the latest `pulumi/yaml` release <details> <summary>Changed files</summary> <ul> <li>Created local directory <code>pkg/codegen/testing/test/testdata/transpiled_examples</code> and copied all sub files/folders from remote directory <code>pkg/tests/transpiled_examples</code></li> </ul> </details> --- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#3269786749](https://github.com/pulumi/pulumi-yaml/actions/runs/3269786749) Co-authored-by: 杨成锴 <homeboyc@foxmail.com> Co-authored-by: Aaron Friel <mayreply@aaronfriel.com> Co-authored-by: pulumi-bot <null> Co-authored-by: Alex Qiu <aqiu@pulumi.com>
- Loading branch information
Showing
66 changed files
with
961 additions
and
173 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
4 changes: 4 additions & 0 deletions
4
changelog/pending/20221010--sdk-go--update-deprecated-things.yaml
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
changes: | ||
- type: chore | ||
scope: sdk/go | ||
description: Update notes, update the deprecated functions, make some lint. |
21 changes: 21 additions & 0 deletions
21
pkg/codegen/testing/test/testdata/transpiled_examples/aws-eks-pp/program.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
vpcId = invoke("aws:ec2/getVpc:getVpc", { | ||
default = true | ||
}).id | ||
subnetIds = invoke("aws:ec2/getSubnetIds:getSubnetIds", { | ||
vpcId = vpcId | ||
}).ids | ||
|
||
resource cluster "eks:index:Cluster" { | ||
__logicalName = "cluster" | ||
vpcId = vpcId | ||
subnetIds = subnetIds | ||
instanceType = "t2.medium" | ||
desiredCapacity = 2 | ||
minSize = 1 | ||
maxSize = 2 | ||
} | ||
|
||
output kubeconfig { | ||
__logicalName = "kubeconfig" | ||
value = cluster.kubeconfig | ||
} |
38 changes: 38 additions & 0 deletions
38
pkg/codegen/testing/test/testdata/transpiled_examples/aws-static-website-pp/program.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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
resource siteBucket "aws-native:s3:Bucket" { | ||
__logicalName = "site-bucket" | ||
websiteConfiguration = { | ||
indexDocument = "index.html" | ||
} | ||
} | ||
|
||
resource indexHtml "aws:s3/bucketObject:BucketObject" { | ||
__logicalName = "index.html" | ||
bucket = siteBucket.id | ||
source = fileAsset("./www/index.html") | ||
acl = "public-read" | ||
contentType = "text/html" | ||
} | ||
|
||
resource faviconPng "aws:s3/bucketObject:BucketObject" { | ||
__logicalName = "favicon.png" | ||
bucket = siteBucket.id | ||
source = fileAsset("./www/favicon.png") | ||
acl = "public-read" | ||
contentType = "image/png" | ||
} | ||
|
||
resource bucketPolicy "aws:s3/bucketPolicy:BucketPolicy" { | ||
__logicalName = "bucketPolicy" | ||
bucket = siteBucket.id | ||
policy = "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Principal\": \"*\",\n \"Action\": [\"s3:GetObject\"],\n \"Resource\": [\"${siteBucket.arn}/*\"]\n }\n ]\n}\n" | ||
} | ||
|
||
output bucketName { | ||
__logicalName = "bucketName" | ||
value = siteBucket.bucketName | ||
} | ||
|
||
output websiteUrl { | ||
__logicalName = "websiteUrl" | ||
value = siteBucket.websiteURL | ||
} |
28 changes: 28 additions & 0 deletions
28
pkg/codegen/testing/test/testdata/transpiled_examples/awsx-fargate-pp/program.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
resource cluster "aws:ecs/cluster:Cluster" { | ||
__logicalName = "cluster" | ||
} | ||
|
||
resource lb "awsx:lb:ApplicationLoadBalancer" { | ||
__logicalName = "lb" | ||
} | ||
|
||
resource nginx "awsx:ecs:FargateService" { | ||
__logicalName = "nginx" | ||
cluster = cluster.arn | ||
taskDefinitionArgs = { | ||
container = { | ||
image = "nginx:latest", | ||
cpu = 512, | ||
memory = 128, | ||
portMappings = [{ | ||
containerPort = 80, | ||
targetGroup = lb.defaultTargetGroup | ||
}] | ||
} | ||
} | ||
} | ||
|
||
output url { | ||
__logicalName = "url" | ||
value = lb.loadBalancer.dnsName | ||
} |
123 changes: 123 additions & 0 deletions
123
pkg/codegen/testing/test/testdata/transpiled_examples/azure-app-service-pp/program.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 |
---|---|---|
@@ -0,0 +1,123 @@ | ||
config sqlAdmin string { | ||
default = "pulumi" | ||
} | ||
|
||
blobAccessToken = secret(invoke("azure-native:storage:listStorageAccountServiceSAS", { | ||
accountName = sa.name, | ||
protocols = "https", | ||
sharedAccessStartTime = "2022-01-01", | ||
sharedAccessExpiryTime = "2030-01-01", | ||
resource = "c", | ||
resourceGroupName = appservicegroup.name, | ||
permissions = "r", | ||
canonicalizedResource = "/blob/${sa.name}/${container.name}", | ||
contentType = "application/json", | ||
cacheControl = "max-age=5", | ||
contentDisposition = "inline", | ||
contentEncoding = "deflate" | ||
}).serviceSasToken) | ||
|
||
resource appservicegroup "azure-native:resources:ResourceGroup" { | ||
__logicalName = "appservicegroup" | ||
} | ||
|
||
resource sa "azure-native:storage:StorageAccount" { | ||
__logicalName = "sa" | ||
resourceGroupName = appservicegroup.name | ||
kind = "StorageV2" | ||
sku = { | ||
name = "Standard_LRS" | ||
} | ||
} | ||
|
||
resource appserviceplan "azure-native:web:AppServicePlan" { | ||
__logicalName = "appserviceplan" | ||
resourceGroupName = appservicegroup.name | ||
kind = "App" | ||
sku = { | ||
name = "B1", | ||
tier = "Basic" | ||
} | ||
} | ||
|
||
resource container "azure-native:storage:BlobContainer" { | ||
__logicalName = "container" | ||
resourceGroupName = appservicegroup.name | ||
accountName = sa.name | ||
publicAccess = "None" | ||
} | ||
|
||
resource blob "azure-native:storage:Blob" { | ||
__logicalName = "blob" | ||
resourceGroupName = appservicegroup.name | ||
accountName = sa.name | ||
containerName = container.name | ||
type = "Block" | ||
source = fileArchive("./www") | ||
} | ||
|
||
resource appInsights "azure-native:insights:Component" { | ||
__logicalName = "appInsights" | ||
resourceGroupName = appservicegroup.name | ||
applicationType = "web" | ||
kind = "web" | ||
} | ||
|
||
resource sqlPassword "random:index/randomPassword:RandomPassword" { | ||
__logicalName = "sqlPassword" | ||
length = 16 | ||
special = true | ||
} | ||
|
||
resource sqlServer "azure-native:sql:Server" { | ||
__logicalName = "sqlServer" | ||
resourceGroupName = appservicegroup.name | ||
administratorLogin = sqlAdmin | ||
administratorLoginPassword = sqlPassword.result | ||
version = "12.0" | ||
} | ||
|
||
resource db "azure-native:sql:Database" { | ||
__logicalName = "db" | ||
resourceGroupName = appservicegroup.name | ||
serverName = sqlServer.name | ||
sku = { | ||
name = "S0" | ||
} | ||
} | ||
|
||
resource app "azure-native:web:WebApp" { | ||
__logicalName = "app" | ||
resourceGroupName = appservicegroup.name | ||
serverFarmId = appserviceplan.id | ||
siteConfig = { | ||
appSettings = [ | ||
{ | ||
name = "WEBSITE_RUN_FROM_PACKAGE", | ||
value = "https://${sa.name}.blob.core.windows.net/${container.name}/${blob.name}?${blobAccessToken}" | ||
}, | ||
{ | ||
name = "APPINSIGHTS_INSTRUMENTATIONKEY", | ||
value = appInsights.instrumentationKey | ||
}, | ||
{ | ||
name = "APPLICATIONINSIGHTS_CONNECTION_STRING", | ||
value = "InstrumentationKey=${appInsights.instrumentationKey}" | ||
}, | ||
{ | ||
name = "ApplicationInsightsAgent_EXTENSION_VERSION", | ||
value = "~2" | ||
} | ||
], | ||
connectionStrings = [{ | ||
name = "db", | ||
type = "SQLAzure", | ||
connectionString = "Server= tcp:${sqlServer.name}.database.windows.net;initial catalog=${db.name};userID=${sqlAdmin};password=${sqlPassword.result};Min Pool Size=0;Max Pool Size=30;Persist Security Info=true;" | ||
}] | ||
} | ||
} | ||
|
||
output endpoint { | ||
__logicalName = "endpoint" | ||
value = app.defaultHostName | ||
} |
Oops, something went wrong.