orange-kite-80991
11/21/2021, 7:35 AMproud-pizza-80589
11/21/2021, 3:31 PMwitty-monitor-18849
11/22/2021, 7:14 PMOutput<string>
to work as an argument to a function like [getsubnetids](https://www.pulumi.com/registry/packages/aws/api-docs/ec2/getsubnetids/) where arguments are of type string
and not Input<string>
?
Such as:
const publicSubnets = ec2.getSubnetIds({
vpcId: vpc.id, // Correctly results in "Type Output<string> is not assignable to type 'string'
tags: {
type: "public",
},
})
magnificent-lifeguard-15082
11/25/2021, 12:16 PMorange-kite-80991
11/28/2021, 9:09 PMconfig:
mystackname:SCHEMA:
secure: qqqqq
mystackname:SCHEMA_CONFIG: https://
azure-native:location: westus2
azure-native:subscriptionId: aaaaaa
azure-native:tenantId: bbbbbb
fluid:password:
secure: ccccccc
fluid:username: abc*<http://xyz.com|xyz.com>
A simple require() or get() can access the mystackname: prefixed values. What's the syntax for accessing the other variables?
const config = new pulumi.Config()
const schema = config.require( 'SCHEMA' )
// the following don't work
const location = config.require( 'location' )
const location = config.require( 'azure-native:location' )
const location = config.require( 'azure-native.location' )
magnificent-lifeguard-15082
11/28/2021, 10:32 PMprivate
properties on classes (in ts) end up in output. I had hoped registerOutputs
might give pulumi some more sense as to what should actually be exported but alas, it does not. Context: exporting reference to a ComponentResource instance.wonderful-twilight-70958
11/29/2021, 3:32 PMfast-easter-23401
11/29/2021, 3:40 PMnginx-ingress
controller and cert-manager
using helm. I was wondering if it is possible to import these resources using kubernetes.helm.v3.Release
. The TS API for helm Releases works like charm when it comes to create new resources, but fails to import existent resources. I manufactured a k8s provider (on GCP) to this end, but got consistently the same error while attempting to import a resource using the class constructor.
kubernetes:<http://helm.sh/v3:Release|helm.sh/v3:Release> (cert-manager):
error: Preview failed: failed to download "cert-manager" at version "v1.1.0"
And here's my code:
const k8sProvider = getKubeconfig(projectId, {
name: cluster.name,
endpoint: cluster.endpoint,
clusterCaCert: cluster.masterAuth.clusterCaCertificate,
});
const certManager = new kubernetes.helm.v3.Release(
'cert-manager',
{
chart: 'cert-manager',
version: 'v1.1.0',
repositoryOpts: {
repo: '<https://charts.jetstack.io>',
},
values: { installCRDs: true },
},
{
import: 'cert-manager',
provider: k8sProvider,
protect: true,
}
);
I'm confident enough that this problem does not relate to the use of my provider (I used it to import successfully secrets, configMaps and some other k8s resources).
Thanks for your help and time.wonderful-twilight-70958
11/29/2021, 3:49 PMv
wonderful-twilight-70958
11/29/2021, 3:50 PMversion: '1.1.0',
little-cartoon-10569
11/30/2021, 1:33 AMsalmon-fish-42319
12/09/2021, 7:36 PMable-hair-32695
12/10/2021, 11:35 PMable-hair-32695
12/11/2021, 12:02 AMpulumi.All
block what’s the proper way to return the role to the caller?salmon-fish-42319
12/11/2021, 3:22 AMfailed with an unhandled exception:
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at <source path>/node_modules/@pulumi/cluster.ts:416:13
at <source path>/node_modules/@pulumi/output.ts:383:31
orange-kite-80991
12/11/2021, 2:51 PMconst az_config = new pulumi.Config('azure-native')
What do I need to add to pull the Azure credentials from the Environment?echoing-activity-32278
12/13/2021, 2:34 PMconst provider = new k8s.Provider("k8s", {
kubeconfig: stack.getOutput("kubeconfig"),
});
How can I reuse this provider in multiple js files?
I’d expect some pulumi.getResourceByName
stuffimportant-vegetable-39003
12/15/2021, 12:15 PMpulumi up
?witty-monitor-18849
12/15/2021, 6:47 PMTypeError: Cannot read property 'arn' of undefined
? To work around it I replace the resource output ARN with a static string but this is not ideal.echoing-activity-32278
12/16/2021, 7:33 AMconst subscriptionFeatureRegistration =
new azure.features.SubscriptionFeatureRegistration(
`${clusterName}-features`,
{
featureName: "EnablePodIdentityPreview",
properties: {state: "Registered"},
providerNamespace: "Microsoft.ContainerService",
}
);
But it erred with:
azure-native:features:SubscriptionFeatureRegistration (example-app2-qa-features):
error: cannot create already existing resource '/subscriptions/xxxxxxyyyyyyzzzzzzz/providers/Microsoft.Features/featureProviders/Microsoft.ContainerService/subscriptionFeatureRegistrations/EnablePodIdentityPreview'
echoing-activity-32278
12/16/2021, 4:05 PM${resources.resourceGroup.name}-nodes
, ? How does the pulumi.interpolate
work? This is ain’t a function call though.miniature-king-36473
12/16/2021, 4:07 PMrefined-terabyte-65361
12/17/2021, 6:33 PMfunction iam(IamPolicyName: string, IamPolicy: string) {
new aws.iam.RolePolicyAttachment(IamPolicyName, {
role: role.name,
policyArn: IamPolicy,
});
}
const IamLambdaPolicy = iam(
"lambdaFullAccess",
`aws.iam.ManagedPolicy.lambdaFullAccess`
);
const IamSqsPolicy = iam(
"SQSFullAccess",
`aws.iam.ManagedPolicy.AmazonSQSFullAccess`
);
but i get error
aws:iam:RolePolicyAttachment (lambdaFullAccess):
error: 1 error occurred:
* Error attaching policy aws.iam.ManagedPolicy.LambdaFullAccess to IAM Role lambdaRole-16d99f4: InvalidInput: ARN aws.iam.ManagedPolicy.LambdaFullAccess is not valid.
status code: 400, request id: 8a1ea825-46fe-43c6-ab65-a6d23cb8f489
aws:iam:RolePolicyAttachment (SQSFullAccess):
error: 1 error occurred:
* Error attaching policy aws.iam.ManagedPolicy.AmazonSQSFullAccess to IAM Role lambdaRole-16d99f4: InvalidInput: ARN aws.iam.ManagedPolicy.AmazonSQSFullAccess is not valid.
status code: 400, request id: 6755daf5-8485-4c0b-8ee8-5f08ef30353e
This works as expected
new aws.iam.RolePolicyAttachment("lambdaFullAccess", {
role: role.name,
policyArn: aws.iam.ManagedPolicy.LambdaFullAccess,
});
new aws.iam.RolePolicyAttachment("SQSFullAccess", {
role: role.name,
policyArn: aws.iam.ManagedPolicy.AmazonSQSFullAccess,
});
but this is not efficient since we have like 6 policies to attach to roleable-hair-32695
12/17/2021, 6:43 PMexport function generateGithubOIDCAssumeRolePolicy(params: {
githubOwner: Input<string>;
repositoryName: Input<string>;
oidcProviderArn: Input<string>;
}): Promise<GetPolicyDocumentResult> {
return getPolicyDocument({
statements: [
{
actions: ['sts:AssumeRoleWithWebIdentity'],
conditions: [
{
test: 'StringLike',
values: [`repo:${params.githubOwner}/${params.repositoryName}:*`],
variable: '<http://token.actions.githubusercontent.com:sub|token.actions.githubusercontent.com:sub>',
},
],
principals: [
{
identifiers: [params.oidcProviderArn],
type: 'Federated',
},
],
},
],
});
}
echoing-activity-32278
12/18/2021, 1:39 AMpulumi up
process stuck in the retry process of a k8s resource? The current way is to wait for 10mins or so. From k8s logs, I can see the retry will fail in the end.echoing-activity-32278
12/18/2021, 1:58 AMechoing-activity-32278
12/19/2021, 3:20 PMbroad-helmet-79436
12/21/2021, 11:30 AMparent
when I make them fields/properties of a ComponentResource class? E.g. here, I would really like to not have to explicitly specify `{ parent: this }`:
class A extends pulumi.ComponentResource {
readonly id: random.RandomId;
constructor(name: string, args: {}, opts: pulumi.ComponentResourceOptions) {
super('martin:A', name, {}, opts);
this.id = new random.RandomId(
name,
{ byteLength: 42 },
{ parent: this }
);
}
}
I think that setting a Pulumi resource as a field in a class that extends pulumi.ComponentResource like I do in the example (and in pretty much all of my code) is a pretty clear expression of intent for the resource to be a child of the component resource class.
I do it this way so I can set providers: [k8sProvider, gcpProvider]
and protect: true
on a single parent resource instead of passing the correct provider to every single resource. And the logical grouping in the diff output is nice too, but not enough that I’d bother to set a field on Every Single Resource.
This is a source of continuous frustration as I keep forgetting about it when I add new resources to classes, and don’t always notice even when I run pulumi up
given that it’s completely valid to define a resource without a parent 😅broad-helmet-79436
12/21/2021, 11:36 AMbroad-helmet-79436
12/21/2021, 11:39 AM