This message was deleted.
s
This message was deleted.
s
Another way to get the url coul be building it by hand. Is there any way to retrieve the aws account id and the region as variables from the pulumi context? That would be pretty good for code sharing
Copy code
const current = aws.iam.getAccountAlias({});
const accountId = current.then(current => current.accountAlias);
This actually might solve the account id problem
l
I think you have to build those by hand. Same for the S3 bucket web access URL.. You can get the account ID and region from `aws.getCallerIdentity`: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/aws/#getCallerIdentity
Ah, maybe not the region...
s
Great, thanks again!
👍 1
Hmm I'm having a small problem when building the url by hand. The queue name is built with:
Copy code
`${this.globalPrefix}-queue-${STACK}`
Where STACK is pulumi.getStack(). The problem is that Pulumi is automatically appending a small hash after this name, giving me something like this in the end: "TESTS-queue-dev-a27c3a0"
I have no idea on how to get this "a27c3a0" suffix and append it to the url builder
l
That bit is the id of the queue. Onesec, I think I've got code that does what you want...
Nope, mine is for SNS.. but you want
name
property, that will include the random bit.
s
hmm ok, it makes sense that I could just take the queue's name instead of trying to rebuild it
l
I think the
name
part is just the last part of the path. The full URL is
<https://sqs>.<region>.<http://amazonaws.com/|amazonaws.com/><accountid>/<queue_name>
You can make that a stack output, it'll print it automatically and be easily available to other projects and stacks.
s
Yep, now I believe I'm building it the correct way because other errors started to appear heheh