Skip to content

Commit 1fcda12

Browse files
authored
(pulumi-bot) Created local 'pkg/codegen/testing/test/testdata/transpiled_examples' from remote 'pkg/tests/transpiled_examples' (#861)
Co-authored-by: pulumi-bot <null>
1 parent 86f3397 commit 1fcda12

File tree

18 files changed

+724
-0
lines changed

18 files changed

+724
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
vpcId = invoke("aws:ec2/getVpc:getVpc", {
2+
default = true
3+
}).id
4+
subnetIds = invoke("aws:ec2/getSubnetIds:getSubnetIds", {
5+
vpcId = vpcId
6+
}).ids
7+
8+
resource cluster "eks:index:Cluster" {
9+
__logicalName = "cluster"
10+
vpcId = vpcId
11+
subnetIds = subnetIds
12+
instanceType = "t2.medium"
13+
desiredCapacity = 2
14+
minSize = 1
15+
maxSize = 2
16+
}
17+
18+
output kubeconfig {
19+
__logicalName = "kubeconfig"
20+
value = cluster.kubeconfig
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
resource siteBucket "aws-native:s3:Bucket" {
2+
__logicalName = "site-bucket"
3+
websiteConfiguration = {
4+
indexDocument = "index.html"
5+
}
6+
}
7+
8+
resource indexHtml "aws:s3/bucketObject:BucketObject" {
9+
__logicalName = "index.html"
10+
bucket = siteBucket.id
11+
source = fileAsset("./www/index.html")
12+
acl = "public-read"
13+
contentType = "text/html"
14+
}
15+
16+
resource faviconPng "aws:s3/bucketObject:BucketObject" {
17+
__logicalName = "favicon.png"
18+
bucket = siteBucket.id
19+
source = fileAsset("./www/favicon.png")
20+
acl = "public-read"
21+
contentType = "image/png"
22+
}
23+
24+
resource bucketPolicy "aws:s3/bucketPolicy:BucketPolicy" {
25+
__logicalName = "bucketPolicy"
26+
bucket = siteBucket.id
27+
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"
28+
}
29+
30+
output bucketName {
31+
__logicalName = "bucketName"
32+
value = siteBucket.bucketName
33+
}
34+
35+
output websiteUrl {
36+
__logicalName = "websiteUrl"
37+
value = siteBucket.websiteURL
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
resource cluster "aws:ecs/cluster:Cluster" {
2+
__logicalName = "cluster"
3+
}
4+
5+
resource lb "awsx:lb:ApplicationLoadBalancer" {
6+
__logicalName = "lb"
7+
}
8+
9+
resource nginx "awsx:ecs:FargateService" {
10+
__logicalName = "nginx"
11+
cluster = cluster.arn
12+
taskDefinitionArgs = {
13+
container = {
14+
image = "nginx:latest",
15+
cpu = 512,
16+
memory = 128,
17+
portMappings = [{
18+
containerPort = 80,
19+
targetGroup = lb.defaultTargetGroup
20+
}]
21+
}
22+
}
23+
}
24+
25+
output url {
26+
__logicalName = "url"
27+
value = lb.loadBalancer.dnsName
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
config sqlAdmin string {
2+
default = "pulumi"
3+
}
4+
5+
blobAccessToken = secret(invoke("azure-native:storage:listStorageAccountServiceSAS", {
6+
accountName = sa.name,
7+
protocols = "https",
8+
sharedAccessStartTime = "2022-01-01",
9+
sharedAccessExpiryTime = "2030-01-01",
10+
resource = "c",
11+
resourceGroupName = appservicegroup.name,
12+
permissions = "r",
13+
canonicalizedResource = "/blob/${sa.name}/${container.name}",
14+
contentType = "application/json",
15+
cacheControl = "max-age=5",
16+
contentDisposition = "inline",
17+
contentEncoding = "deflate"
18+
}).serviceSasToken)
19+
20+
resource appservicegroup "azure-native:resources:ResourceGroup" {
21+
__logicalName = "appservicegroup"
22+
}
23+
24+
resource sa "azure-native:storage:StorageAccount" {
25+
__logicalName = "sa"
26+
resourceGroupName = appservicegroup.name
27+
kind = "StorageV2"
28+
sku = {
29+
name = "Standard_LRS"
30+
}
31+
}
32+
33+
resource appserviceplan "azure-native:web:AppServicePlan" {
34+
__logicalName = "appserviceplan"
35+
resourceGroupName = appservicegroup.name
36+
kind = "App"
37+
sku = {
38+
name = "B1",
39+
tier = "Basic"
40+
}
41+
}
42+
43+
resource container "azure-native:storage:BlobContainer" {
44+
__logicalName = "container"
45+
resourceGroupName = appservicegroup.name
46+
accountName = sa.name
47+
publicAccess = "None"
48+
}
49+
50+
resource blob "azure-native:storage:Blob" {
51+
__logicalName = "blob"
52+
resourceGroupName = appservicegroup.name
53+
accountName = sa.name
54+
containerName = container.name
55+
type = "Block"
56+
source = fileArchive("./www")
57+
}
58+
59+
resource appInsights "azure-native:insights:Component" {
60+
__logicalName = "appInsights"
61+
resourceGroupName = appservicegroup.name
62+
applicationType = "web"
63+
kind = "web"
64+
}
65+
66+
resource sqlPassword "random:index/randomPassword:RandomPassword" {
67+
__logicalName = "sqlPassword"
68+
length = 16
69+
special = true
70+
}
71+
72+
resource sqlServer "azure-native:sql:Server" {
73+
__logicalName = "sqlServer"
74+
resourceGroupName = appservicegroup.name
75+
administratorLogin = sqlAdmin
76+
administratorLoginPassword = sqlPassword.result
77+
version = "12.0"
78+
}
79+
80+
resource db "azure-native:sql:Database" {
81+
__logicalName = "db"
82+
resourceGroupName = appservicegroup.name
83+
serverName = sqlServer.name
84+
sku = {
85+
name = "S0"
86+
}
87+
}
88+
89+
resource app "azure-native:web:WebApp" {
90+
__logicalName = "app"
91+
resourceGroupName = appservicegroup.name
92+
serverFarmId = appserviceplan.id
93+
siteConfig = {
94+
appSettings = [
95+
{
96+
name = "WEBSITE_RUN_FROM_PACKAGE",
97+
value = "https://${sa.name}.blob.core.windows.net/${container.name}/${blob.name}?${blobAccessToken}"
98+
},
99+
{
100+
name = "APPINSIGHTS_INSTRUMENTATIONKEY",
101+
value = appInsights.instrumentationKey
102+
},
103+
{
104+
name = "APPLICATIONINSIGHTS_CONNECTION_STRING",
105+
value = "InstrumentationKey=${appInsights.instrumentationKey}"
106+
},
107+
{
108+
name = "ApplicationInsightsAgent_EXTENSION_VERSION",
109+
value = "~2"
110+
}
111+
],
112+
connectionStrings = [{
113+
name = "db",
114+
type = "SQLAzure",
115+
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;"
116+
}]
117+
}
118+
}
119+
120+
output endpoint {
121+
__logicalName = "endpoint"
122+
value = app.defaultHostName
123+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
config sqlAdmin string {
2+
default = "pulumi"
3+
}
4+
5+
config retentionInDays int {
6+
default = 30
7+
}
8+
9+
sharedKey = secret(invoke("azure-native:operationalinsights:getSharedKeys", {
10+
resourceGroupName = resourceGroup.name,
11+
workspaceName = workspace.name
12+
}).primarySharedKey)
13+
adminRegistryCreds = invoke("azure-native:containerregistry:listRegistryCredentials", {
14+
resourceGroupName = resourceGroup.name,
15+
registryName = registry.name
16+
})
17+
adminUsername = adminRegistryCreds.username
18+
adminPasswords = secret(adminRegistryCreds.passwords)
19+
20+
resource resourceGroup "azure-native:resources:ResourceGroup" {
21+
__logicalName = "resourceGroup"
22+
}
23+
24+
resource workspace "azure-native:operationalinsights:Workspace" {
25+
__logicalName = "workspace"
26+
resourceGroupName = resourceGroup.name
27+
sku = {
28+
name = "PerGB2018"
29+
}
30+
retentionInDays = retentionInDays
31+
}
32+
33+
resource kubeEnv "azure-native:web:KubeEnvironment" {
34+
__logicalName = "kubeEnv"
35+
resourceGroupName = resourceGroup.name
36+
environmentType = "Managed"
37+
appLogsConfiguration = {
38+
destination = "log-analytics",
39+
logAnalyticsConfiguration = {
40+
customerId = workspace.customerId,
41+
sharedKey = sharedKey
42+
}
43+
}
44+
}
45+
46+
resource registry "azure-native:containerregistry:Registry" {
47+
__logicalName = "registry"
48+
resourceGroupName = resourceGroup.name
49+
sku = {
50+
name = "Basic"
51+
}
52+
adminUserEnabled = true
53+
}
54+
55+
resource provider "pulumi:providers:docker" {
56+
__logicalName = "provider"
57+
registryAuth = [{
58+
address = registry.loginServer,
59+
username = adminUsername,
60+
password = adminPasswords[0].value
61+
}]
62+
}
63+
64+
resource myImage "docker:index/registryImage:RegistryImage" {
65+
__logicalName = "myImage"
66+
name = "${registry.loginServer}/node-app:v1.0.0"
67+
build = {
68+
context = "${cwd()}/node-app"
69+
}
70+
71+
options {
72+
provider = provider
73+
}
74+
}
75+
76+
resource containerapp "azure-native:web:ContainerApp" {
77+
__logicalName = "containerapp"
78+
resourceGroupName = resourceGroup.name
79+
kubeEnvironmentId = kubeEnv.id
80+
configuration = {
81+
ingress = {
82+
external = true,
83+
targetPort = 80
84+
},
85+
registries = [{
86+
server = registry.loginServer,
87+
username = adminUsername,
88+
passwordSecretRef = "pwd"
89+
}],
90+
secrets = [{
91+
name = "pwd",
92+
value = adminPasswords[0].value
93+
}]
94+
}
95+
template = {
96+
containers = [{
97+
name = "myapp",
98+
image = myImage.name
99+
}]
100+
}
101+
}
102+
103+
output endpoint {
104+
__logicalName = "endpoint"
105+
value = "https://${containerapp.configuration.ingress.fqdn}"
106+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
resource staticsitegroup "azure-native:resources:ResourceGroup" {
2+
__logicalName = "staticsitegroup"
3+
}
4+
5+
resource storageaccount "azure-native:storage:StorageAccount" {
6+
__logicalName = "storageaccount"
7+
resourceGroupName = staticsitegroup.name
8+
kind = "StorageV2"
9+
sku = {
10+
name = "Standard_LRS"
11+
}
12+
}
13+
14+
resource staticwebsite "azure-native:storage:StorageAccountStaticWebsite" {
15+
__logicalName = "staticwebsite"
16+
resourceGroupName = staticsitegroup.name
17+
accountName = storageaccount.name
18+
indexDocument = "index.html"
19+
error404Document = "404.html"
20+
}
21+
22+
resource indexHtml "azure-native:storage:Blob" {
23+
__logicalName = "index.html"
24+
resourceGroupName = staticsitegroup.name
25+
accountName = storageaccount.name
26+
containerName = staticwebsite.containerName
27+
contentType = "text/html"
28+
type = "Block"
29+
source = fileAsset("./www/index.html")
30+
}
31+
32+
resource faviconPng "azure-native:storage:Blob" {
33+
__logicalName = "favicon.png"
34+
resourceGroupName = staticsitegroup.name
35+
accountName = storageaccount.name
36+
containerName = staticwebsite.containerName
37+
contentType = "image/png"
38+
type = "Block"
39+
source = fileAsset("./www/favicon.png")
40+
}
41+
42+
resource "404Html" "azure-native:storage:Blob" {
43+
__logicalName = "404.html"
44+
resourceGroupName = staticsitegroup.name
45+
accountName = storageaccount.name
46+
containerName = staticwebsite.containerName
47+
contentType = "text/html"
48+
type = "Block"
49+
source = fileAsset("./www/404.html")
50+
}
51+
52+
output endpoint {
53+
__logicalName = "endpoint"
54+
value = storageaccount.primaryEndpoints.web
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
resource rawkode "eks:index:Cluster" {
2+
__logicalName = "rawkode"
3+
instanceType = "t2.medium"
4+
desiredCapacity = 2
5+
minSize = 1
6+
maxSize = 2
7+
}
8+
9+
resource stack72 "eks:index:Cluster" {
10+
__logicalName = "stack72"
11+
instanceType = "t2.medium"
12+
desiredCapacity = 4
13+
minSize = 1
14+
maxSize = 8
15+
}

0 commit comments

Comments
 (0)