sticky-receptionist-53934
09/08/2020, 6:04 PMastonishing-quill-88807
09/08/2020, 7:00 PMapply
function to update a cloud-init data structure, but for some reason it seems that the apply function isn't getting reliably executed before launching an instance. The code is here: https://github.com/mitodl/ol-infrastructure/blob/consul_component/src/ol_infrastructure/infrastructure/operations/consul.py#L191-L218astonishing-quill-88807
09/08/2020, 7:01 PMbitter-application-91815
09/08/2020, 7:31 PMastonishing-quill-88807
09/08/2020, 7:37 PMlimited-ability-67435
09/08/2020, 7:40 PMnarrow-jackal-57645
09/09/2020, 2:50 AMimport * as aws from "@pulumi/aws";
const getAccountARN = (accountId: string, resource: string = "*") => {
return `arn:aws:iam::${accountId}:${resource}`
}
interface UserList {
[username: string]: aws.iam.User;
}
const accountID = "437763615564"
let users: UserList = {};
// create 1 user
const user1 = new aws.iam.User("user1", {
name: "user1"
});
users["user1"] = user1;
// create a new role with sts:AssumeRole for those users
const assumeRolePolicy = aws.iam.getPolicyDocument({
statements: [{
effect: "Allow",
actions: ["sts:AssumeRole"],
principals: [{
type: "AWS",
identifiers: Object.keys(users).map((username) => {
return getAccountARN(accountID, `user/${username}`)
})
}]
}]
});
const role = new aws.iam.Role("devs", {
assumeRolePolicy: assumeRolePolicy.then(policy => policy.json),
name: "super-uber-devs"
}, {
dependsOn: Object.values(users)
});
2) apply then add another user:
const user2 = new aws.iam.User("user2", {
name: "user2"
});
users["user2"] = user2;
apply and got error:
Updating (testo):
Type Name Status Info
pulumi:pulumi:Stack iam-infrastructure-testo **failed** 1 error
+ ├─ aws:iam:User user2 created
~ └─ aws:iam:Role devs **updating failed** [diff: ~assumeRolePolicy]; 1 error
Diagnostics:
pulumi:pulumi:Stack (iam-infrastructure-testo):
error: update failed
aws:iam:Role (devs):
error: 1 error occurred:
* updating urn:pulumi:testo::iam-infrastructure::aws:iam/role:Role::devs: Error Updating IAM Role (super-uber-devs) Assume Role Policy: MalformedPolicyDocument: Invalid principal in policy: "AWS":"arn:aws:iam::437763615564:user/user2"
status code: 400, request id: 3359e6d9-7d65-4e87-a000-0b19be9173ca
Resources:
+ 1 created
2 unchanged
What's the best way to ensure that role would wait until the new user resource is successfully created before updating its assumeRolePolicy
. I was attempting to use dependsOn
to achieve that but it does not work out as I expected.
Any guidance is greatly appreciatedworried-stone-50514
09/09/2020, 4:08 AMbitter-application-91815
09/09/2020, 10:32 AMlimited-rainbow-51650
09/09/2020, 12:26 PM{
parent: this,
aliases: [
{ parent: pulumi.rootStackResource }
],
transformations: [pluginConfigurator]
}
Yesterday, I added a transformation callback function to add environment variables to the container spec of a Kubernetes StatefulSet
resource. Today, I wanted to re-parent this StatefulSet
under it’s parent custom resource class. So I added the parent
and aliases
as above. But with this in place, I get the stack trace:
pulumi:pulumi:Stack: (same)
[urn=urn:pulumi:development::orthanc::pulumi:pulumi:Stack::orthanc-development]
error: Running program '/Users/ringods/Projects/osimis/devops-sessions/pulumi/orthanc' failed with an unhandled exception:
Error: Transformations cannot currently be used to change the `parent` of a resource.
at new Resource (/Users/ringods/Projects/osimis/devops-sessions/pulumi/orthanc/node_modules/@pulumi/pulumi/resource.js:124:27)
...
My transformation is not changing the parent
at all. How can I get rid of this error?gray-city-50684
09/09/2020, 5:45 PMdamp-secretary-81951
09/09/2020, 5:54 PMconst customer1ApiKey = new aws.apigateway.ApiKey("customer-1", {});
Would it be better to store these API key values in my stack config?astonishing-quill-88807
09/09/2020, 7:32 PMastonishing-quill-88807
09/09/2020, 7:44 PM--disable-integrity-checking
flag.square-rose-64819
09/09/2020, 9:07 PMsquare-rose-64819
09/09/2020, 9:07 PMpanic: nil context
goroutine 83 [running]:
net/http.(*Request).WithContext(...)
/opt/hostedtoolcache/go/1.14.4/x64/src/net/http/request.go:358
<http://golang.org/x/net/context/ctxhttp.Do|golang.org/x/net/context/ctxhttp.Do>(0x0, 0x0, 0x5473a40, 0xc0010b4600, 0xe579395829c4e5cd, 0x10, 0x32943a0)
/home/runner/go/pkg/mod/golang.org/x/net@v0.0.0-20200625001655-4c5254603344/context/ctxhttp/ctxhttp.go:27 +0x324
<http://golang.org/x/oauth2/internal.doTokenRoundTrip(0x0|golang.org/x/oauth2/internal.doTokenRoundTrip(0x0>, 0x0, 0xc0010b4600, 0x48, 0xc0006120a0, 0x18)
/home/runner/go/pkg/mod/golang.org/x/oauth2@v0.0.0-20200107190931-bf48bf16ab8d/internal/token.go:232 +0x7b
<http://golang.org/x/oauth2/internal.RetrieveToken(0x0|golang.org/x/oauth2/internal.RetrieveToken(0x0>, 0x0, 0xc000048780, 0x48, 0xc0006120a0, 0x18, 0x395ecf5, 0x23, 0xc000d3c8b0, 0x1, ...)
/home/runner/go/pkg/mod/golang.org/x/oauth2@v0.0.0-20200107190931-bf48bf16ab8d/internal/token.go:202 +0xdf
<http://golang.org/x/oauth2.retrieveToken(0x0|golang.org/x/oauth2.retrieveToken(0x0>, 0x0, 0xc00032c850, 0xc000d3c8b0, 0xc000d3c980, 0x15, 0x381e7e0)
/home/runner/go/pkg/mod/golang.org/x/oauth2@v0.0.0-20200107190931-bf48bf16ab8d/token.go:157 +0x92
<http://golang.org/x/oauth2.(*tokenRefresher).Token(0xc0005d07b0|golang.org/x/oauth2.(*tokenRefresher).Token(0xc0005d07b0>, 0x10dc2ad, 0x3910f5d, 0x6)
/home/runner/go/pkg/mod/golang.org/x/oauth2@v0.0.0-20200107190931-bf48bf16ab8d/oauth2.go:270 +0x1de
<http://golang.org/x/oauth2.(*reuseTokenSource).Token(0xc001094840|golang.org/x/oauth2.(*reuseTokenSource).Token(0xc001094840>, 0x0, 0x0, 0x0)
/home/runner/go/pkg/mod/golang.org/x/oauth2@v0.0.0-20200107190931-bf48bf16ab8d/oauth2.go:304 +0xa8
<http://golang.org/x/oauth2.(*Transport).RoundTrip(0xc0005e21a0|golang.org/x/oauth2.(*Transport).RoundTrip(0xc0005e21a0>, 0xc000b90200, 0x0, 0x0, 0x0)
/home/runner/go/pkg/mod/golang.org/x/oauth2@v0.0.0-20200107190931-bf48bf16ab8d/transport.go:45 +0x9e
<http://github.com/hashicorp/terraform-plugin-sdk/helper/logging.(*transport).RoundTrip(0xc0005e21c0|github.com/hashicorp/terraform-plugin-sdk/helper/logging.(*transport).RoundTrip(0xc0005e21c0>, 0xc000b90200, 0xc000d3cc20, 0x1, 0x1)
/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.11.0/helper/logging/transport.go:27 +0x164
<http://github.com/terraform-providers/terraform-provider-google-beta/google-beta.(*retryTransport).RoundTrip(0xc000a82540|github.com/terraform-providers/terraform-provider-google-beta/google-beta.(*retryTransport).RoundTrip(0xc000a82540>, 0xc00090f700, 0x0, 0x0, 0x0)
/home/runner/go/pkg/mod/github.com/pulumi/terraform-provider-google-beta@v0.0.0-20200727210524-5e1c545f84af/google-beta/retry_transport.go:125 +0x2c5
net/http.send(0xc00090f600, 0x3ee3b60, 0xc000a82540, 0xbfce6ede4b5aa590, 0x71b07f8e8, 0x5473e80, 0xc00000f388, 0xbfce6ede4b5aa590, 0x1, 0x0)
/opt/hostedtoolcache/go/1.14.4/x64/src/net/http/client.go:252 +0x43e
net/http.(*Client).send(0xc000a82510, 0xc00090f600, 0xbfce6ede4b5aa590, 0x71b07f8e8, 0x5473e80, 0xc00000f388, 0x0, 0x1, 0x14e6d62)
/opt/hostedtoolcache/go/1.14.4/x64/src/net/http/client.go:176 +0xfa
net/http.(*Client).do(0xc000a82510, 0xc00090f600, 0x0, 0x0, 0x0)
/opt/hostedtoolcache/go/1.14.4/x64/src/net/http/client.go:699 +0x44a
net/http.(*Client).Do(...)
/opt/hostedtoolcache/go/1.14.4/x64/src/net/http/client.go:567
<http://google.golang.org/api/internal/gensupport.SendRequest|google.golang.org/api/internal/gensupport.SendRequest>(0x0, 0x0, 0xc000a82510, 0xc00090f600, 0xc000da7320, 0x5e, 0x0)
/home/runner/go/pkg/mod/google.golang.org/api@v0.26.0/internal/gensupport/send.go:42 +0x23d
<http://google.golang.org/api/cloudresourcemanager/v1.(*ProjectsGetCall).doRequest(0xc000da74f0|google.golang.org/api/cloudresourcemanager/v1.(*ProjectsGetCall).doRequest(0xc000da74f0>, 0x390e896, 0x4, 0x0, 0x100c9a8, 0x30)
/home/runner/go/pkg/mod/google.golang.org/api@v0.26.0/cloudresourcemanager/v1/cloudresourcemanager-gen.go:6532 +0x75e
<http://google.golang.org/api/cloudresourcemanager/v1.(*ProjectsGetCall).Do(0xc000da74f0|google.golang.org/api/cloudresourcemanager/v1.(*ProjectsGetCall).Do(0xc000da74f0>, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/runner/go/pkg/mod/google.golang.org/api@v0.26.0/cloudresourcemanager/v1/cloudresourcemanager-gen.go:6544 +0xa1
<http://github.com/terraform-providers/terraform-provider-google-beta/google-beta.resourceGoogleProjectServiceRead(0xc00001af50|github.com/terraform-providers/terraform-provider-google-beta/google-beta.resourceGoogleProjectServiceRead(0xc00001af50>, 0x34fd300, 0xc00043bc00, 0xc00001af50, 0x0)
/home/runner/go/pkg/mod/github.com/pulumi/terraform-provider-google-beta@v0.0.0-20200727210524-5e1c545f84af/google-beta/resource_google_project_service.go:160 +0x17e
<http://github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Refresh(0xc000a21320|github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Refresh(0xc000a21320>, 0xc000bb2640, 0x34fd300, 0xc00043bc00, 0xc000989b18, 0x1, 0x3713b40)
/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.11.0/helper/schema/resource.go:516 +0x16f
<http://github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Refresh(0xc0000fc800|github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Refresh(0xc0000fc800>, 0xc000da77d8, 0xc000bb2640, 0xc000a40300, 0xc000544a20, 0xc000d90000)
/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.11.0/helper/schema/provider.go:333 +0x8f
<http://github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfbridge.(*Provider).Read(0xc000a0fba0|github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfbridge.(*Provider).Read(0xc000a0fba0>, 0x3f1aea0, 0xc000db0660, 0xc000bb25f0, 0xc000a0fba0, 0x3476701, 0xc000baf500)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v2@v2.5.4/pkg/tfbridge/provider.go:751 +0x716
<http://github.com/pulumi/pulumi/sdk/v2/proto/go._ResourceProvider_Read_Handler.func1(0x3f1aea0|github.com/pulumi/pulumi/sdk/v2/proto/go._ResourceProvider_Read_Handler.func1(0x3f1aea0>, 0xc000db0660, 0x37e2780, 0xc000bb25f0, 0x382efa0, 0x549faa8, 0x3f1aea0, 0xc000db0660)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v2@v2.5.1-0.20200701223250-45d2fa95d60b/proto/go/provider.pb.go:1902 +0x86
<http://github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x3f1aea0|github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x3f1aea0>, 0xc000db03c0, 0x37e2780, 0xc000bb25f0, 0xc000d889c0, 0xc000d889e0, 0x0, 0x0, 0x3ee2fe0, 0xc0001cbbc0)
/home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x2eb
<http://github.com/pulumi/pulumi/sdk/v2/proto/go._ResourceProvider_Read_Handler(0x389fc80|github.com/pulumi/pulumi/sdk/v2/proto/go._ResourceProvider_Read_Handler(0x389fc80>, 0xc000a0fba0, 0x3f1aea0, 0xc000db03c0, 0xc0000bde00, 0xc0000b1ea0, 0x3f1aea0, 0xc000db03c0, 0xc000ba0900, 0x201)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v2@v2.5.1-0.20200701223250-45d2fa95d60b/proto/go/provider.pb.go:1904 +0x14b
<http://google.golang.org/grpc.(*Server).processUnaryRPC(0xc000a0fa00|google.golang.org/grpc.(*Server).processUnaryRPC(0xc000a0fa00>, 0x3f52fc0, 0xc000782480, 0xc000942b00, 0xc000a6ac30, 0x545f560, 0x0, 0x0, 0x0)
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.28.0/server.go:1082 +0x50a
<http://google.golang.org/grpc.(*Server).handleStream(0xc000a0fa00|google.golang.org/grpc.(*Server).handleStream(0xc000a0fa00>, 0x3f52fc0, 0xc000782480, 0xc000942b00, 0x0)
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.28.0/server.go:1405 +0xcc9
<http://google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00056c020|google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00056c020>, 0xc000a0fa00, 0x3f52fc0, 0xc000782480, 0xc000942b00)
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.28.0/server.go:746 +0xa1
created by <http://google.golang.org/grpc.(*Server).serveStreams.func1|google.golang.org/grpc.(*Server).serveStreams.func1>
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.28.0/server.go:744 +0xa1
square-rose-64819
09/09/2020, 9:08 PMlittle-cartoon-10569
09/10/2020, 4:10 AMpulumi preview
is complaining about not having the aws plugin, but it's not telling me what version to install (I think it used to), and I don't know where to look for versions of the aws plugin.
The issue that best describes the problem says that the error message should include the verison number. Plus the link to the trouble-shooting topic is out of date 😞best-france-51653
09/10/2020, 9:25 AMminiature-scientist-54855
09/10/2020, 10:20 AMminiature-scientist-54855
09/10/2020, 10:20 AM# pulumi-gke
./main.go:33:6: main redeclared in this block
previous declaration at ./somefile.go:114:6
error: an unhandled error occurred: program exited with non-zero exit code: 2
miniature-scientist-54855
09/10/2020, 10:22 AMdamp-elephant-82829
09/10/2020, 1:01 PMworried-umbrella-80893
09/10/2020, 3:14 PMimportant-appointment-55126
09/10/2020, 3:18 PMworried-umbrella-80893
09/10/2020, 3:19 PMloud-battery-37784
09/10/2020, 3:20 PMloud-battery-37784
09/10/2020, 3:22 PMimportant-appointment-55126
09/10/2020, 3:25 PMpulumi stack
takes ~10 seconds atmimportant-appointment-55126
09/10/2020, 3:25 PMimportant-appointment-55126
09/10/2020, 3:25 PM