jolly-plumber-1488
04/22/2023, 4:58 AMechoing-oil-42947
04/22/2023, 3:05 PMmain
field in a stack configuration? Or does that need to be project wide? I've dealt with having multiple stacks per project (that are the same, just env specific), and also having multiple projects per repo, but I was wondering if 1 project can contain stacks with different content somehowacceptable-lawyer-72941
04/23/2023, 2:17 PM{
"name": "test_k8s_cluster",
"main": "index.ts",
"devDependencies": {
"@types/figlet": "^1.5.5",
"@types/node": "^16"
},
"dependencies": {
"@pulumi/aws": "^5.37.0",
"@pulumi/awsx": "^1.0.2",
"@pulumi/cloudflare": "^5.0.0",
"@pulumi/eks": "^1.0.1",
"@pulumi/kubernetes": "^3.25.0",
"@pulumi/pulumi": "^3.64.0",
"@pulumi/tls": "^4.10.0",
"figlet": "^1.6.0"
}
}
index.ts (imports):
import * as awsx from "@pulumi/awsx";
import * as aws from "@pulumi/aws";
import * as eks from "@pulumi/eks";
import * as k8s from "@pulumi/kubernetes";
import * as cloudflare from "@pulumi/cloudflare";
import * as pulumi from "@pulumi/pulumi";
import * as tls from "@pulumi/tls";
index.ts (offending code):
const CLUSTER_KEY_GENERATION_ALGORITHM = "ED25519";
const awsRegion: aws.Region = awsConfig.require("region");
const awsProvider = new aws.Provider("aws-provider", {
region: awsRegion,
});
// Create a PrivateKey for the Kubernetes cluster
const clusterPrivateKey = new tls.PrivateKey("cluster-private-key", {
algorithm: CLUSTER_KEY_GENERATION_ALGORITHM,
}, { provider: awsProvider });
output:
❯ pulumi up
Previewing update (dev)
View in Browser (Ctrl+O): <https://app.pulumi.com/xxx/xxx/dev/previews/a4>....
Type Name Plan Info
pulumi:pulumi:Stack xxxxx-infra-aws-dev 1 error
~ ├─ pulumi:providers:aws aws-provider update [diff: ~version]
+ ├─ aws:ec2:Eip bastion-eip create
+ ├─ aws:ec2:KeyPair bastion-key-pair create
└─ tls:index:PrivateKey cluster-private-key 1 error
Diagnostics:
tls:index:PrivateKey (cluster-private-key):
error: unrecognized resource type (Check): tls:index/privateKey:PrivateKey
There seems to be an extra “index” but not sure why. Is this a bug or am I using @pulumi/tls incorrectly?
Thank you for your help.acceptable-lawyer-72941
04/23/2023, 2:18 PMimport { PrivateKey } from "@pulumi/tls";
and got the same result.salmon-musician-36333
04/23/2023, 5:57 PM@pulumi/kubernetes
helm.v3.Chart
and @pulumi/eks
Cluster
for this purpose. Looking at the docs, I'm not seeing a way that I can pass the Cluster
to helm.v3.Chart
, rather that it will be running the chart against whatever cluster is helm
default on my system at the time. Is there a way to point it at the cluster I've just created without having to first set up the EKS cluster, then make it default in my shell, and then run the charts deploy?
PS One of the charts I want to deploy is the AWS EFS CSI driver, going by the note on https://www.pulumi.com/blog/persisting-kubernetes-workloads-with-amazon-efscsi-volumes-using-pulumi-sdks/ that it's recommended to use the sigs chart for this. Is that still the case?salmon-musician-36333
04/23/2023, 9:28 PMhelm.v3.Chart
, I now have:
{
providers: { kubernetes: eksCluster.provider },
dependsOn: [eksCluster, istioIngress],
},
I'm getting a bunch of this:
error: Error: invocation of kubernetes:helm:template returned an error: failed to generate YAML for specified Helm chart: could not get server version from Kubernetes: Get "...": x509: certificate is not valid for any names, but wanted to match ...
I've tried this with only dependsOn
and only providers
as well, thinking there may be a conflict. Based on the speed of the run, I thought maybe this was because it's not waiting for the k8s cluster to come up, but perhaps there's something else going on. Any ideas?salmon-musician-36333
04/23/2023, 11:41 PMaws:ec2:SecurityGroup
. Is there a way to tell it do delete as much as it can so there aren't > 100 things that need to be trashed manually?wooden-queen-36575
04/23/2023, 11:48 PM../../../
in my imports, so that I can refer to all my lib
files using an alias from all of my stacks. I've defined the paths in the tsconfig.json
file in the root of the repository, and have additionally referred to this using extends
in a tsconfig.json
file in each stack folder. The aliases aren't resolving, so I'm getting Cannot find module
. Is this kind of thing supported currently?cuddly-easter-41456
04/24/2023, 4:33 AMnew Resource
... with a password, that is auto-generated on the fly.
As soon as I hit the same code next time, I don't have that password any longer. I don't want to generate a new password everytime I run the same code, so I'd rather try to see if the resource already exists and load this, instead of creating a new one. Is there a way how to do that? The documentation is not quite clear on this.
Also, I have a Dynamic Resource where I do this myself. I see that there is the read() Function for, I assume, this case. But I don't find any way on how to trigger this function during my automation code. Any pointers to documentation, example code, or what to search for would be much appreciatedbusy-notebook-25546
04/24/2023, 11:51 AMsalmon-musician-36333
04/24/2023, 1:05 PMBucketNotification
, but it still doesn't want to come down cleanly—somehow this SecurityGroup
still doesn't want to go away:
aws:ec2:SecurityGroup (...):
error: deleting urn:pulumi:dev::...::eks:index:Cluster$aws:ec2/securityGroup:SecurityGroup::...: 1 error occurred:
* deleting Security Group (...): DependencyViolation: resource ... has a dependent object
status code: 400, request id: ...
Is there a way to get Pulumi to find the dependent instances, or, failing that bring down the deployment dirty (delete what it can until it's only getting these kind of errors)? I assume if the dependent it's referring to were in the state file then it would be trying to bring it down first anyway, and pulumi refresh
hasn't brought it in.
Would also be happy to have any suggestions on what toggles I should be setting with helm.v3.Release
so that it upgrades cleanly; after I got the cluster up the first time, I ran pulumi up
again to see if it would confirm that it's in the desired state, but then got upgrade failures for several of my charts.salmon-musician-36333
04/24/2023, 1:09 PMsparse-intern-71089
04/24/2023, 3:46 PMbrief-car-60542
04/24/2023, 4:19 PMlimited-river-80186
04/24/2023, 7:38 PMCommand
I am debugging and bringing everything up and down takes too longhallowed-horse-57635
04/24/2023, 11:53 PMsalmon-musician-36333
04/25/2023, 12:29 AMOutput<List<T>>
other than apply(l => l.map(...))
? I've been looking at (1), which suggests it's best not to create resources in an .apply
, and (2) which suggests that sometimes this is the only way to do it.
1. https://www.pulumi.com/docs/intro/concepts/inputs-outputs/#apply
2. https://github.com/pulumi/pulumi/issues/5392gifted-barista-41153
04/25/2023, 1:12 AMpulumi state upgrade
after upgrading to Pulumi >=3.61.0, but I get Upgraded 0 stack(s) to project mode
pulumi state upgrade
This will upgrade the current backend to the latest supported version.
Older versions of Pulumi will not be able to read the new format.
Are you sure you want to proceed?
Please confirm that this is what you'd like to do by typing `yes`: yes
Upgraded 0 stack(s) to project mode
Is that normal? I’m using S3 as my backend, and the project structure still looks the same (Pulumi.yaml is still present in the bucket, and there is no meta.yaml)
This has been happening on all my projects, and there are several stacks in each project. Interestingly, I can still seemingly run pulumi commands as usual on newer versions.crooked-crayon-60838
04/25/2023, 6:54 AMpulumi/aws
supports creating "wafv2.WebAclRules" after the creation of the WAF with new aws.wafv2.WebAcl(...)
?
in the AWS-CLI it is supported here "create-rule", and it can be done also from AWS web console, but pulumi doesn't seem to have it...
It would allow my team to create the WAF in a shared project while allowing specific domains to add more rules to the WAF afterwards.creamy-monkey-35142
04/25/2023, 7:36 AMGroupMembership
, I want get User.id that was created at the previous function and is there anyway to do that without doing pulumi.export
?limited-rainbow-51650
04/25/2023, 8:15 AMcuddly-angle-21517
04/25/2023, 8:20 AMfast-island-38778
04/25/2023, 11:14 AMfast-island-38778
04/25/2023, 11:16 AMfierce-school-40904
04/25/2023, 12:17 PMastonishing-librarian-23155
04/25/2023, 1:16 PMException: invoke of aws:eks/getCluster:getCluster failed: invocation of aws:eks/getCluster:getCluster returned an error: error reading from server: EOF
Any suggestions on how to get around this? Thanks
Note: I have imported eks as from pulumi_aws import eks
def generate_cross_account_kubeconfig(cluster_name:str, role_arn: str):
eks_provider = Provider(
f"assume-role-{role_arn.split('/')[1]}",
assume_role = [
role_arn,
]
)
eks_cluster= eks.get_cluster(
name=cluster_name,
opts = pulumi.InvokeOptions(provider = eks_provider)
)
salmon-musician-36333
04/25/2023, 4:44 PMawsx.ec2.Vpc
. Looking at https://www.pulumi.com/registry/packages/awsx/api-docs/ec2/vpc/, it seems that the usual "All input properties are implicitly available as output properties." applies, but vpc.availabilityZoneNames
throws an error. Any ideas?salmon-musician-36333
04/25/2023, 6:02 PMdefaultTags
, but including already created resources)?limited-engineer-94414
04/25/2023, 6:05 PMinvidual
account and now want to migrate to organization
is it just as simple as running pulumi org set-default <NEW ORG NAME>
and then running pulumi up to deploy the services there? what will happen to what was registered with the individual account?salmon-musician-36333
04/25/2023, 8:20 PM+- ├─ aws:rds:Cluster postgres replace [diff: ~availabilityZones,dbClusterInstanceClass]
Error:
error: 1 error occurred:
* creating RDS Cluster (...): DBClusterAlreadyExistsFault: DB Cluster already exists
status code: 400, request id: ...
I'm still testing the deployment, so I'm going to bring the whole thing down and go from there, just wondering if this is expected. deletionProtection
is disabled.