roadiehq / backstage-plugin-aws-auth Goto Github PK
View Code? Open in Web Editor NEWAuthenticate Backstage plugins against the AWS APIs
Home Page: https://roadie.io
Authenticate Backstage plugins against the AWS APIs
Home Page: https://roadie.io
Can you please help me out with the AWS credentials?
async function generateCredentials(backendUrl: string) {
const reqBody = JSON.stringify({ RoleArn: 'arn:aws:iam::0123456789012:role/Example' });
const resp = await (await fetch(`${backendUrl}/aws/credentials`, { body: reqBody })).json();
return new AWS.Credentials({
accessKeyId: resp.AccessKeyId,
secretAccessKey: resp.SecretAccessKey,
sessionToken: resp.SessionToken,
});
}
AWS.config.credentials = await generateCredentials(backendUrl);
Clear instructions would be very helpful, as I am getting errors with my own steps.
Currently creds are needed to be exported as env variables. Modify initialization logic to use AWS preferred functionality to go through the default AWS credential provider chain instead.
See: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html
In a environment with multiple VPC's it would be ideal to be able to authenticate using IAM Groups
It would be great to have this plugin support role switching when operating within an AWS organization. It's pretty rare that all your resources are contained within the same AWS account, and I'd like to be able to access other accounts without needing to change the AWS keys available in the keychain for each call.
For something like the (backstage-plugin-aws-lambda)[https://github.com/RoadieHQ/backstage-plugin-aws-lambda] project, if we could provide a roleArn
directive to the metadata annotations, and the backend AWS auth would use the default credentials to assume the role before attempting the API call, we'd be able to safely do cross-account AWS API calls.
For example
metadata:
annotations:
aws.com/role-arn: arn:aws:iam::123456789012:role/Backstage
aws.com/lambda-function-name: HelloWorld
aws.com/lambda-region: us-east-1
The plugin would use the existing credentials chain available to it, and use the assumeRole
functionality within STS
to get temporary credentials to use for the subsequent getFunctionByName
call.
Extending generateCredentials
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.