dry-journalist-60579
03/08/2023, 10:49 PMError: fetching AWS credentials: WebIdentityErr: failed to retrieve credentials, caused by: AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity, status code: 403
Any ideas?
I’m using Pulumi to create the OIDC configuration and AWS roles:
import pulumi_aws as aws
import json
# Create OIDC provider for Pulumi Deployments
oidc_provider = aws.iam.OpenIdConnectProvider(
"Pulumi OIDC Provider",
client_id_lists=["MYORG"],
# <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc_verify-thumbprint.html>
thumbprint_lists=["9E99A48A9960B14926BB7F3B02E22DA2B0AB7280"],
url="<https://api.pulumi.com/oidc>",
)
oidc_provider_role = aws.iam.Role(
"Pulumi OIDC Provider Role",
name="PulumiOIDC",
assume_role_policy=oidc_provider.arn.apply(
lambda arn: json.dumps(
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": arn,
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"<http://api.pulumi.com/oidc:aud|api.pulumi.com/oidc:aud>": "MYORG",
"<http://api.pulumi.com/oidc:sub|api.pulumi.com/oidc:sub>": "pulumi:deploy:org:MYORG:project:*:*",
}
},
}
],
}
)
),
)
icy-controller-6092
03/09/2023, 9:09 AM{ parent: xyz }
doesn’t already provide?bumpy-plastic-18391
03/09/2023, 3:23 PMquaint-twilight-92541
03/09/2023, 6:53 PM.ts
files? I'd like to verify what I think of as idiomatic TypeScript and the preferred approach of the Pulumi community.dry-journalist-60579
03/09/2023, 8:17 PMvirtualenv
project configuration are not yet supported` I’m getting from Deployments with the fact that we’re using Poetry for our dependencies like this article demonstrates. Any suggestions?limited-wolf-14679
03/09/2023, 11:48 PMlimited-wolf-14679
03/09/2023, 11:49 PM# new kubeflow
kubeflow = gcp.container.Registry("kubeflow")
deployment = Deployment(
"kubeflow-deployment",
spec=DeploymentSpecArgs(
replicas=1,
selector=LabelSelectorArgs(
match_labels={
"app": "kubeflow",
},
),
template=PodTemplateSpecArgs(
metadata=ObjectMetaArgs(
labels={
"app": "kubeflow",
},
),
spec=PodSpecArgs(
containers=[
ContainerArgs(
name="kubeflow",
image="kubeflow",
env=[
EnvVarArgs(
name="NAMESPACE",
value="kubeflow",
),
],
command=["/bin/bash"],
args=[
"-c",
"/opt/deploy.sh",
]
)
]
)
)
),
metadata=ObjectMetaArgs(
labels={
"app": "kubeflow",
}
)
)
pulumi.export("name", deployment.metadata["name"])
# Allocate an IP to the Deployment.
app_name = "kubeflow"
app_labels = { "app": app_name }
frontend = Service(
app_name,
metadata={
"labels": deployment.spec["template"]["metadata"]["labels"],
},
spec={
"type": "LoadBalancer",
"ports": [{ "port": 80, "target_port": 80, "protocol": "TCP" }],
"selector": app_labels,
})
# When "done", this will print the public IP.
result = None
ingress = frontend.status.apply(lambda v: v["load_balancer"]["ingress"][0] if "load_balancer" in v else None)
if ingress is not None:
result = ingress.apply(lambda v: v["ip"] if "ip" in v else v["hostname"])
pulumi.export("ip", result)
incalculable-rose-91093
03/10/2023, 4:42 AMdry-journalist-60579
03/10/2023, 3:01 PMkind-farmer-90323
03/10/2023, 9:23 PMplain-belgium-35196
03/11/2023, 1:10 AMacceptable-lawyer-72941
03/12/2023, 6:53 PMnew awsx.ec2.Vpc("vpc-name", ...)
I am passing in a list of subnetSpecs:
const subnetSpecs = [
{
type: awsx.ec2.SubnetType.Public,
name: "public",
cidrMask: 24,
tags: {
...publicSubnetTags,
},
},
{
type: awsx.ec2.SubnetType.Private,
name: "kubernetes",
cidrMask: 24,
tags: {
...privateSubnetTags,
},
},
{
type: awsx.ec2.SubnetType.Private,
name: "rds",
cidrMask: 24,
tags: {
...rdsSubnetTags,
},
},
];
rdsSunetTags is:
const rdsSubnetTags : {
Name: "rds",
};
Finally, and this is where I am stuck, after the call to new awsx.ec2.Vpc("vpc-name", ...)
I want to create a subnet group for the rds subnets and attempt to do so as follows:
// Create RDS subnet group
aws.ec2
.getSubnets({
tags: {
Name: "rds",
},
})
.then((rdsSubnets) => {
console.log("rdsSubnets: ", rdsSubnets);
// create a subnet group for the RDS subnets
const rdsSubnetGroup = new aws.rds.SubnetGroup("rds-subnet-group", {
subnetIds: rdsSubnets.ids,
tags: {
Environment: env,
},
});
});
Not surprisingly, rdsSubnets contains an empty list of subnets because new awsx.ec2.Vpc hasn't completed provisioning resources yet and there, in fact, are no subnets in the VPC.
What is the right approach? Is there a way to get a Subnet promise that resolves when the the VPC and all of the subnets have been created?
Thank you.purple-electrician-80135
03/13/2023, 12:40 AMacceptable-plumber-31485
03/13/2023, 6:52 PMacceptable-plumber-31485
03/14/2023, 2:30 AMpulumi up
was complaining about export. I tried creating it as a typescript as well as javascript. Both failed. It does look like it's a javascript code. Any ideas?acceptable-plumber-31485
03/14/2023, 4:55 PMpulumi preview
will see the difference. I would like to see if it works the same as terraform plan
. However, it didn't see the manual change I made. What am I doing wrong?plain-belgium-35196
03/15/2023, 6:43 PMpurple-cat-2685
03/17/2023, 1:37 PMimport type "symbiosis:Cluster" is not a valid resource type token. Type tokens must be of the format <package><module><type>What am I missing?🫣
melodic-lion-63741
03/17/2023, 2:40 PMhallowed-airport-19484
03/17/2023, 6:58 PMbucketUrl
, but the entire URL is not returned (eg., nothing like "http://" at the beginning). This means it is not a URL, as no scheme is present.
I find this a bit troubling... is this loose application of domain terms like "URL" par for the course, or just an outlier?numerous-alarm-76016
03/20/2023, 10:26 AMstraight-fireman-55591
03/21/2023, 11:28 AMfancy-artist-45287
03/21/2023, 11:46 AMcareful-summer-45848
03/21/2023, 7:53 PMname: my-site
runtime: nodejs
main: ./index.ts
config:
aws:region: us-east-1
domain: <http://robcarr.net|robcarr.net>
tags:
type: array
items:
- production
- staging
// Pulumi.default.yaml
name: default
config:
aws:region: us-east-1
domain: <http://robcarr.net|robcarr.net>
tags:
type: array
items:
- production
- staging
8 errors occurred:
* #/config/tags: oneOf failed
* #/config/tags: expected string, but got object
* #/config/tags: expected integer, but got object
* #/config/tags: expected boolean, but got object
* #/config/tags: expected array, but got object
* #/config/tags: doesn't validate with '/$defs/configTypeDeclaration'
* #/config/tags/items: doesn't validate with '/$defs/configItemsType'
* #/config/tags/items: expected object, but got arraybrief-car-60542
03/24/2023, 4:23 AMPulumi.<cluster>.yaml
And some yaml file with resource A, some yaml with resource B. Seems each resource will trying to build with all stack files.
Here is a example project structure I am going with:
├── infrastructure
│ ├── iac
│ │ ├── aws
│ │ │ ├── containers
│ │ │ │ ├── index.ts
│ │ │ │ ├── package.json
│ │ │ │ ├── Pulumi.yaml
│ │ │ │ ├── Pulumi.foo.yaml
│ │ │ │ ├── Pulumi.bar.yaml
│ │ │ │ ├── ecr
│ │ │ │ │ ├── index.ts
│ │ │ │ ├── fargate
│ │ │ │ │ ├── index.ts
Like a example here
Pulumi.foo.yaml
will only have ecr
resource.
Pulumi.bar.yaml
will only have fargate
resource.
How do I make each resource index.ts
smartly know if there is no config about ecr in the stack yaml file. I will do nothing.billowy-ability-25334
03/24/2023, 12:36 PMcareful-summer-45848
03/24/2023, 4:09 PMexport function setCloudFrontRecordAAAA(
name: string,
distribution: aws.cloudfront.Distribution,
zone: aws.route53.Zone
) {
const record = new aws.route53.Record("AAAA-alias", {
name,
type: "AAAA",
zoneId: zone.zoneId,
aliases: [
{
evaluateTargetHealth: true,
name: distribution.domainName,
zoneId: distribution.hostedZoneId,
},
],
});
return record;
}
export function setCloudFrontWWWAlias(
name: string,
record: aws.route53.Record,
) {
const wwwRecord = new aws.route53.Record("www-alias", {
name,
type: "AAAA",
zoneId: record.zoneId,
aliases: {
name: record.name, <--- LINTER DOESN'T LIKE THIS
zoneId: record.zoneId,
evaluateTargetHealth: true,
}
});
return wwwRecord;
}
brief-car-60542
03/28/2023, 3:47 AMPulumi.yaml
file?incalculable-thailand-44404
03/28/2023, 8:47 PMrhythmic-kangaroo-93098
03/30/2023, 7:56 AM