bumpy-laptop-30846
09/07/2023, 9:46 AMgorgeous-lunch-7514
09/08/2023, 1:15 PMaws:s3:BucketObject (index.html):
warning: urn:pulumi:dev::admin::aws:s3/bucketObject:BucketObject::index.html verification warning: use the aws_s3_object resource instead
error: aws:s3/bucketObject:BucketObject resource 'index.html' has a problem: Attribute must be a single value, not a map. Examine values at 'index.html.bucket'.
gorgeous-lunch-7514
09/08/2023, 1:16 PMconst adminBucketDir = `${__dirname}/../build/`;
const updatedFiles: BucketObject[] = [];
crawlDirectory(adminBucketDir, (filePath: string) => {
const relativeFilePath = filePath.replace(adminBucketDir + "/", "");
console.log(relativeFilePath, filePath);
const contentFile = new aws.s3.BucketObject(
relativeFilePath,
{
key: relativeFilePath,
acl: "public-read",
bucket: config.adminBucket,
contentType: mime.getType(filePath) || undefined,
source: new pulumi.asset.FileAsset(filePath),
}
);
updatedFiles.push(contentFile);
});
sparse-optician-70334
09/08/2023, 9:17 PMambitious-agent-35343
09/11/2023, 8:47 AMimport * as pulumi from "@Pulumi Novice/pulumi";
import * as databricks from "@Pulumi Novice/databricks";
// initialize provider at account-level
const mws = new databricks.Provider("mws", {
host: "<https://accounts.cloud.databricks.com>",
accountId: "00000000-0000-0000-0000-000000000000",
username: _var.databricks_account_username,
password: _var.databricks_account_password,
});
const accountUser = new databricks.User("accountUser", {
userName: "<mailto:me@example.com|me@example.com>",
displayName: "Example user",
}, {
provider: databricks.mws,
});
rough-morning-53309
09/11/2023, 9:41 PMsparse-optician-70334
09/12/2023, 7:25 AMimport pulumi
from pulumi_aws_native import s3
# Create an AWS resource (S3 Bucket)
bucket = s3.Bucket("my_bucket")
pulumi.export("my_bucket", bucket.id)
with open('./Pulumi.README.md') as f:
pulumi.export('readme', f.read())
The readme with contents of:
- main bucket ${bucket.id}
- my_bucket ${my_bucket}
The file is neatly uploaded. However, the ${} reference to the variable is never resolved and empty. What do I need to change to get the variables to resolve?sparse-optician-70334
09/12/2023, 8:36 AMimport pulumi
from pulumi_aws_native import s3, iam
import json
from pulumi_databricks import MwsWorkspaces, MwsCredentials, MwsStorageConfigurations, MwsNetworks, get_aws_assume_role_policy, get_aws_cross_account_policy, ServicePrincipal, ServicePrincipalSecret
import pulumi_databricks as databricks
from jinja2 import Environment, FileSystemLoader
from pathlib import Path
db_account_id = config.require('db_account_id')
creds = MwsCredentials("my-db-credentials", credentials_name="my-db-credentials",
# ARN of <https://docs.databricks.com/en/administration-guide/account-settings-e2/credentials.html#step-1-create-a-cross-account-iam-role> (already craeted)
role_arn=cross_account_role.arn, account_id=f"{db_account_id}")
storage_config = MwsStorageConfigurations("my-storage-config",
# bucket_databricks_root -> already created
bucket_name=bucket_databricks_root.id,
storage_configuration_name="my-storage-config",
account_id=f"{db_account_id}")
workspace = MwsWorkspaces("my-workspace",
account_id=f"{db_account_id}",
aws_region=region,
credentials_id=creds.credentials_id,
storage_configuration_id=storage_config.storage_configuration_id,
workspace_name="myname",)
ambitious-agent-35343
09/12/2023, 2:47 PMgorgeous-lunch-7514
09/13/2023, 9:23 AMgorgeous-lunch-7514
09/13/2023, 9:23 AMgorgeous-lunch-7514
09/13/2023, 9:23 AMsparse-caravan-37954
09/13/2023, 2:03 PMcontainer_properties = {
"jobRoleArn": batch_role.arn,
"command": [
'sh',
'-c',
'echo Ref::param1'
],
"image": image_uri,
"memory": 1024*2,
"vcpus": 1,
}
job_definition = aws.batch.JobDefinition("jobDefinition",
type="container",
container_properties=pulumi.Output.json_dumps(container_properties)
),
parameters={
"param1": "pippo",
},
)
When the job is run, however, the output is Ref::param1
instead of pippo
.
I think the problem is in the fact that the container properties definition contains pulumi Output objects (batch_role
and image_uri
are resources defined before in the full code) and therefore I need the pulumi.Output.json_dumps
story when using it in the job definition, and this is somehow avoiding the parameters to be picked up. Any idea? (edited)gorgeous-lunch-7514
09/13/2023, 4:01 PMexport const oidcProviderIdentity = cluster.core.oidcProvider?.id;
export const oidcProviderARN = cluster.core.oidcProvider?.arn;
gorgeous-lunch-7514
09/13/2023, 4:01 PMgorgeous-lunch-7514
09/13/2023, 4:02 PMgorgeous-lunch-7514
09/13/2023, 4:17 PMgorgeous-lunch-7514
09/13/2023, 4:17 PMgorgeous-lunch-7514
09/14/2023, 1:34 PM// Get OIDC issuer identity.
const oidcProviderURL = cluster.eksCluster.identities.apply(identities => {
return identities[0].oidcs[0].issuer.replace(/(^\w+:|^)\/\//, "").replace(/\/$/, "");
});
// Get AWS Account ID.
const awsAccountID = aws.getCallerIdentity().then(identity => identity.accountId);
// Get thumbprint of the OIDC issuer identity using certificate authority data.
const oidcProviderThumbprint = cluster.eksCluster.certificateAuthority.apply(ca => {
const data = ca.data;
const ascii = Buffer.from(data, "base64").toString("ascii");
const thumbprint = crypto.createHash("sha1").update(ascii).digest("hex");
return thumbprint;
});
// Create an IAM OIDC provider.
const oidcProvider = new aws.iam.OpenIdConnectProvider(`${projectName}-oidc-provider`, {
clientIdLists: ["<http://sts.amazonaws.com|sts.amazonaws.com>"],
url: oidcProviderURL.apply(url => `https://${url}`),
thumbprintLists: [oidcProviderThumbprint],
});
gorgeous-lunch-7514
09/14/2023, 2:13 PMeks.certAuth
and the certificate for the OIDC provider are different?gorgeous-lunch-7514
09/14/2023, 2:17 PM// OpenID config
const oidcConfig = oidcProviderURL.apply(url => {
return axios.get(`https://${url}/.well-known/openid-configuration`).then(response => response.data);
});
// Get thumbprint of the OIDC issuer identity using certificate authority data.
const oidcProviderThumbprint = oidcConfig.apply(config => {
const parsedJwksUri = new URL(config.jwks_uri);
// Use TLS to get hostname's SSL certificate.
const tlsSocket = tls.connect(443, parsedJwksUri.hostname, { servername: parsedJwksUri.hostname });
return new Promise((resolve, reject) => {
tlsSocket.on("secureConnect", () => {
const certificate = tlsSocket.getPeerCertificate();
tlsSocket.end();
console.log(certificate.fingerprint)
const fingerprint = certificate.fingerprint.replace(/:/g, "").toUpperCase();
resolve(fingerprint);
});
tlsSocket.on("error", (error) => {
reject(error);
});
});
});
bulky-apple-458
09/14/2023, 7:12 PMpulumi/pulumi-aws-iam
and seeing issues related to misconfigured CI jobs. Let me know if there’s another channel for these kinds of requests 🙏
https://github.com/pulumi/pulumi-aws-iam/pull/17kind-motorcycle-43615
09/18/2023, 12:27 PMPulumi.Awsx.Ec2.Vpc
(Pulumi C#), Network ACLs and Route Tables with routes are automatically generated.
(Suppose the VPC has 3 availability zones
, and each availability zone has a public
and a private
subnet.)
I have a couple of questions:
1) How can we add new routes to the route table of the public subnet in availability-zone-1? AND how can we add new rules to the Network ACL of the public subnet in availability-zone-1?
2) Is that possible to access those automatically created resources like Network ACLs, Route Tables and modify them? OR Do we need to go with Pulumi AWS Classic
package?
Your input and guidance are highly valued.
TYIAstale-secretary-86178
09/18/2023, 2:37 PMwooden-egg-90698
09/18/2023, 6:55 PMable-machine-72645
09/18/2023, 10:00 PMDiagnostics:
pulumi:pulumi:Stack (superstate-jon-dev):
Error: invocation of aws:ec2/getVpc:getVpc returned an error: invoking aws:ec2/getVpc:getVpc: 1 error occurred:
* no matching EC2 VPC found
: Error: invocation of aws:ec2/getVpc:getVpc returned an error: invoking aws:ec2/getVpc:getVpc: 1 error occurred:
* no matching EC2 VPC found
at Object.callback (/snapshot/awsx/node_modules/@pulumi/pulumi/runtime/invoke.js:148:33)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client.ts:338:26)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client-interceptors.ts:426:34)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client-interceptors.ts:389:48)
at /snapshot/awsx/node_modules/@grpc/grpc-js/src/call-stream.ts:276:24
at processTicksAndRejections (node:internal/process/task_queues:78:11)
error: Error: invocation of aws:ec2/getVpc:getVpc returned an error: invoking aws:ec2/getVpc:getVpc: 1 error occurred:
* no matching EC2 VPC found
at Object.callback (/snapshot/awsx/node_modules/@pulumi/pulumi/runtime/invoke.js:148:33)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client.ts:338:26)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client-interceptors.ts:426:34)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client-interceptors.ts:389:48)
at /snapshot/awsx/node_modules/@grpc/grpc-js/src/call-stream.ts:276:24
at processTicksAndRejections (node:internal/process/task_queues:78:11)
error: Running program '/Users/jon/Developer/superstate/devops/index.ts' failed with an unhandled exception:
<ref *1> Error: failed to register new resource loadbalancer [awsx:lb:ApplicationLoadBalancer]: 2 UNKNOWN: invocation of aws:ec2/getVpc:getVpc returned an error: invoking aws:ec2/getVpc:getVpc: 1 error occurred:
* no matching EC2 VPC found
at Object.registerResource (/Users/jon/Developer/superstate/devops/node_modules/@pulumi/runtime/resource.ts:421:27)
at new Resource (/Users/jon/Developer/superstate/devops/node_modules/@pulumi/resource.ts:507:13)
at new ComponentResource (/Users/jon/Developer/superstate/devops/node_modules/@pulumi/resource.ts:1011:9)
at new ApplicationLoadBalancer (/Users/jon/Developer/superstate/devops/node_modules/@pulumi/lb/applicationLoadBalancer.ts:98:9)
at Object.<anonymous> (/Users/jon/Developer/superstate/devops/index.ts:142:22)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module.m._compile (/Users/jon/Developer/superstate/devops/node_modules/ts-node/src/index.ts:439:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Object.require.extensions.<computed> [as .ts] (/Users/jon/Developer/superstate/devops/node_modules/ts-node/src/index.ts:442:12)
at Module.load (node:internal/modules/cjs/loader:1091:32) {
promise: Promise { <rejected> [Circular *1] }
}
I’m trying to:
1. Create a VPC
2. Create an application load balance in that VPC
const vpc = new awsx.ec2.Vpc("superstate-vpc", {});
const loadbalancerSecurityGroup = new aws.ec2.SecurityGroup("loadbalancerSecurityGroup", {
vpcId: vpc.vpcId,
ingress: [{
fromPort: 0,
toPort: 0,
protocol: "-1",
cidrBlocks: ["0.0.0.0/0"],
ipv6CidrBlocks: ["::/0"],
}],
egress: [{
fromPort: 0,
toPort: 65535,
protocol: "TCP",
cidrBlocks: ["0.0.0.0/0"],
ipv6CidrBlocks: ["::/0"],
}],
});
// Create a load balancer to listen for requests and route them to the container.
const loadbalancer = new awsx.lb.ApplicationLoadBalancer("loadbalancer", {
securityGroups: [ loadbalancerSecurityGroup.id ]
});
Any thoughts on what’s going wrong?ambitious-salesmen-98185
09/19/2023, 12:12 AMambitious-agent-35343
09/19/2023, 9:53 AMdatabricks:index:SqlQuery (q1):
error: 1 error occurred:
* cannot create sql query: Internal Server Error
The query -- I've tried numerous variants, including from docs:
export const q1 = new databricks.SqlQuery("q1", {
dataSourceId: sqlEndpoint.id,
query: "SELECT 1",
runAsRole: "owner",
description: "Query 1",
name: "q1",
tags: ["t1", "t2"],
});
CC: @sparse-optician-70334sparse-teacher-52109
09/19/2023, 3:15 PMable-machine-72645
09/19/2023, 8:11 PMpulumi up