fierce-camera-61577
07/11/2021, 6:46 AMindex.ts
file, and also organize it so that infrastructure definition is separate from “runtime” application (e.g. Lambda code), you may have encountered issues with either compiling (module not found) or runtime (tslib not found) because you didn’t have all your runtime application code in the same part of the directory tree as the infrastructure code, and used import
to either non-relative or ../
paths.curved-pharmacist-41509
07/12/2021, 6:37 AMgreen-pencil-17360
07/12/2021, 6:13 PMstages: [
{
name: "Source",
actions: [{
name: "Source",
category: "Source",
owner: "ThirdParty",
provider: "Github",
version: "1",
outputArtifacts: ["source_output"],
configuration: {
ConnectionArn: "",
FullRepositoryId: "",
BranchName: "develop",
},
}],
},
Its returning me this error.
Error creating CodePipeline: InvalidActionDeclarationException: ActionType (Category: 'Source', Provider: 'Github', Owner: 'ThirdParty', Version: '1') in action 'Source' is not available in region 'US_WEST_2'
green-pencil-17360
07/12/2021, 6:14 PMrefined-terabyte-65361
07/12/2021, 7:48 PMrefined-terabyte-65361
07/12/2021, 7:49 PMgreen-daybreak-98726
07/12/2021, 9:22 PM-new
suffix for the time being).
Can you think of any other way I might be able to work around an issue like this?green-daybreak-98726
07/13/2021, 1:29 AMaws:lambda:Function (eu-west-2-dev-dbtester-func):
error: 1 error occurred:
* error creating Lambda Function: RequestEntityTooLargeException:
status code: 413, request id: 84cfdf77-4668-4921-a3fd-8635f200245a
little-market-63455
07/13/2021, 6:00 PMasync/await
really awkward. you need to wrap the main code in an async funtion then call that from index.ts
using the then/catch/finally
syntax. Not the end of the world but truly annoying
2. You could wrap all async code in pulumi.output
which is perfect for things that are resources or resource-like but not really needed for other async API calls
3. Certain things like IAM policies which are arguably part of almost every single AWS program don't support Input<T>
properties. I don't want to create an independent IAM policy for every IAM role/user (mainly because that indicates they are re-usable and then you need to assign them an intuitive name) so I tend to use inline policies which suffer from the aforementioned problem. I feel either those should accept Input<T>
or there should be dedicated IamInlinePolicyDocument
type that does. Wrapping everything in all()/apply()
is just resulting in ugly looking code when used excessivelyrefined-terabyte-65361
07/13/2021, 6:47 PMimport * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const foo = new aws.ecr.Repository("foo", {
imageScanningConfiguration: {
scanOnPush: true,
},
imageTagMutability: "MUTABLE",
});
but when my repo gets created i am expecting name to be foo but it creates repo with random id foo-719afa7
how to create repo without random id ?breezy-butcher-78604
07/14/2021, 5:57 AMdeleteBeforeReplace
removed from resource options recently? I can't see it in the type declaration with @pulumi/pulumi
v3.6.1green-daybreak-98726
07/14/2021, 4:44 PMancient-eve-13947
07/15/2021, 4:14 PMacceptable-army-69872
07/16/2021, 6:11 PMfunction createProviderMap(o_accounts: aws.organizations.Account[]): Map <string, aws.Provider> {
let providerMap = new Map();
o_accounts.map( o_account => {
pulumi.all([o_account.id, o_account.name ]).apply ( ([id, name]) => {
providerMap.set(name, new aws.Provider(`${id}-provider`, {
assumeRole: {
roleArn: `arn:aws:iam::${id}:role/OrganizationAccountAccessRole`,
sessionName: "PulumiSession",
},
profile: config_aws.require('profile'),
region: aws.config.requireRegion(),
}));
});
});
console.log(providerMap);
}
I feel like I'm missing something big, but this is my first use of Map. Perhaps the issue is I'm creating the provider inside of a .all
...thoughts?refined-terabyte-65361
07/16/2021, 9:10 PMImport sources within a group must be alphabetized.
import {ecr} from "./ecr/index";
function:
import * as aws from "@pulumi/aws";
export function ecr (ecrRepo : string){
new aws.ecr.Repository( ecrRepo, {
imageScanningConfiguration: {
scanOnPush: true,
},
imageTagMutability: "MUTABLE",
name: ecrRepo
});
}
Can someone help me fix this
Thanksrough-window-15889
07/17/2021, 9:16 PMelegant-crayon-4967
07/19/2021, 7:37 PMechoing-zebra-28421
07/20/2021, 4:56 PMnew aws.apigatewayv2.Route(
test-route,
{
apiId: apigw.id,
routeKey: "POST /api/pets",
target: pulumi.interpolate`integrations/${integration.id}`,
},
{ provider },
);
But, I need to create a route to pass a parameter to the endpoint
new aws.apigatewayv2.Route(
test-route,
{
apiId: apigw.id,
routeKey: "GET /api/pets/3",
target: pulumi.interpolate`integrations/${integration.id}`,
},
{ provider },
);
echoing-zebra-28421
07/20/2021, 4:58 PM/api/pets/$id
?stocky-france-59380
07/22/2021, 1:20 AMconfig:
aws:region: us-east-1
pulumi_node:application-dashboards:
- namespace: api-platform
topic:
- ap-topic-1
- ap-topic-2
applications:
- name: template-api-reference
topic:
- tar-topic-1
- tar-topic-2
- name: msk-healthcheck-consumer
- name: msk-healthcheck-producer
let pulumiConfig = new pulumi.Config()
let applicationDashboards = pulumiConfig.getObject<ApplicationDashboards[]>("application-dashboards")
export interface ApplicationDashboards {
namespace: string
topic: string[]
applications: {
name: string
topic: string[]
}[]
}
This produces the output below
console.log(JSON.stringify(applicationDashboards))
console.log(applicationDashboards)
[{"applications":[{"name":"template-api-reference","topic":["tar-topic-1","tar-topic-2"]},{"name":"msk-healthcheck-consumer"},{"name":"msk-healthcheck-producer"}],"namespace":"api-platform","topic":["ap-topic-1","ap-topic-2"]}]
[
{
applications: [ [Object], [Object], [Object] ],
namespace: 'api-platform',
topic: [ 'ap-topic-1', 'ap-topic-2' ]
}
]
astonishing-tiger-81216
07/22/2021, 2:01 PMconst orgCertificate = new acm.Certificate('org-certificate', {
domainName: orgZone.name,
validationMethod: 'DNS'
})
let validationRecords: pulumi.Output<string>[] = []
for (let i in orgCertificate.domainValidationOptions) {
validationRecords.push(
new route53.Record(`org-validation-record-${i}`, {
name: orgCertificate.domainValidationOptions[i].resourceRecordName,
type: orgCertificate.domainValidationOptions[i].resourceRecordType,
records: [ orgCertificate.domainValidationOptions[i].resourceRecordValue ],
zoneId: orgZone.zoneId,
ttl: 60,
allowOverwrite: true
}).fqdn
)
}
new acm.CertificateValidation('org-certificate-validation', {
certificateArn: orgCertificate.arn,
validationRecordFqdns: validationRecords
})
I get this error:
error: Running program '/Users/mallison/workspace/gdsgroup/equiv/immersify' failed with an unhandled exception:
Error: Missing required property 'name'
at new Record (/Users/MYNAME/workspace/DIR/DIR/DIR/node_modules/@pulumi/route53/record.ts:246:23)
gifted-island-55702
07/23/2021, 9:43 AMmy-provider
). I add it as a dependency in my pulumi program using git url (so I have "my-provider": "git+ssh……"
in my pulumi program package.json). Now when I try to run pulumi up
I’m getting: TypeError: Class constructor Resource cannot be invoked without 'new'
. Both my provider module and my pulumi program tsconfig.json is the following:
{
"compilerOptions": {
"strict": true,
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.ts"
]
}
Any hints what I might be doing wrong?busy-soccer-65968
07/26/2021, 9:23 PMcrd2pulumi
which generates the types, but it seems to not install the CRD since 1.0.5 here . is there a recommended way to allow pulumi to control installing it as well as getting types.refined-terabyte-65361
07/27/2021, 12:40 AMconfig:
foo:bar: dev
i am see this in Pulumi.dev.yamlrefined-terabyte-65361
07/27/2021, 12:45 AMastonishing-tiger-81216
07/27/2021, 10:36 AMconst iamId = (): (pulumi.Input<string> | pulumi.Output<string>) => {
return account.name.apply(name => name.includes('iam')) ? account.id : args.iamAccountId
}
refined-terabyte-65361
07/27/2021, 6:59 PMPulumi.dev.yaml
Pulumi.test.yaml
Pulumi.prod.yaml
and
index.ts
in pulumi.foo.yaml file there are some variables which are being used by index.ts
how does pulumi know where to access variable from
eg:
there is a variable present in all 3 files
Pulumi.dev.yaml
foo:project: dev
Pulumi.test.yaml
foo:project: test
Pulumi.prrod.yaml
foo:project: prod
how does pulumi up know where to get the variable from ?refined-terabyte-65361
07/28/2021, 7:45 PMrefined-terabyte-65361
07/28/2021, 9:09 PMlittle-whale-73288
07/29/2021, 2:21 PMOutput<string>
into aws.iam.GetPolicyDocumentArgs
? this attempt:
const policy = aws.iam.getPolicyDocument({statements: [{
actions: ["sts:AssumeRoleWithWebIdentity"],
principals: [{
identifiers: [bitbucket.oidcProvider.arn], // this is line 14
type: "Federated",
}],
condition: {
test: "StringLike",
variable: bitbucket.oidcProvider.url.apply(url => `${url.replace("https://", "")}:sub`),
values: ["...."],
}
}]})
results in:
pulumi.ts(14,23): error TS2322: Type 'Output<string>' is not assignable to type 'string'.
little-whale-73288
07/29/2021, 2:21 PMOutput<string>
into aws.iam.GetPolicyDocumentArgs
? this attempt:
const policy = aws.iam.getPolicyDocument({statements: [{
actions: ["sts:AssumeRoleWithWebIdentity"],
principals: [{
identifiers: [bitbucket.oidcProvider.arn], // this is line 14
type: "Federated",
}],
condition: {
test: "StringLike",
variable: bitbucket.oidcProvider.url.apply(url => `${url.replace("https://", "")}:sub`),
values: ["...."],
}
}]})
results in:
pulumi.ts(14,23): error TS2322: Type 'Output<string>' is not assignable to type 'string'.
astonishing-tiger-81216
07/29/2021, 2:27 PMidentifiers: [bitbucket.oidcProvider.arn.apply(arn => arn)],
I’m afraid that’s my best guess right now.little-whale-73288
07/29/2021, 2:28 PMastonishing-tiger-81216
07/29/2021, 2:32 PMlittle-whale-73288
07/29/2021, 2:41 PMassumeRolePolicy: bitbucket.oidcProvider.arn.apply(
providerArn => pulumi.all([bitbucket.oidcProvider.arn, bitbucket.oidcProvider.url]).apply(
([arn, url]) =>
aws.iam.getPolicyDocument({statements: [{
actions: ["sts:AssumeRoleWithWebIdentity"],
principals: [{
identifiers: [arn],
type: "Federated",
}],
conditions: [{
test: "StringLike",
variable: `${url.replace("https://", "")}:sub`,
values: ["..."],
}],
}]}).then(doc => doc.json)
)
)
assumeRolePolicy : output<string>
echoing-actor-55539
07/29/2021, 3:59 PMidentifiers: [pulumi.interpolate`{bitbucket.oidcProvider.arn}`]
clever-sunset-76585
07/29/2021, 4:32 PMpulumi.interpolate
is your friend for these sorts of things when using JS/TS. So try:
identifiers: [pulumi.interpolate`${bitbucket.oidcProvider.url.replace("https://", "")}:sub`]
identifiers
doesn’t take an Output<string>
. So yeah you will need to use an outer apply
to get the plain string value. As for the string interpolation you are doing inside variable
you could use pulumi.interpolate
for such.little-cartoon-10569
07/29/2021, 10:39 PMgetPolicyDocument()
function.
(Code untested.. I'm particularly not confident in the LHS of the condition...)apply()
to generate the document. You only need apply()
to transform fields. Or in this case, pulumi.interpolate
.clever-sunset-76585
07/29/2021, 10:43 PMaws.iam.getPolicyDocument
@little-whale-73288. If it was to simply construct a policy document that you can use with a Policy
resource, you could just use the aws.iam.PolicyDocument
type as @little-cartoon-10569 suggests. That is overall better than trying to encapsulate everything inside an apply
.