-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new backend system support to AWS catalog provider #1708
Closed
fjudith
wants to merge
6
commits into
RoadieHQ:main
from
alithya-oss:feature/aws-provider-new-backend
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@roadiehq/catalog-backend-module-aws': minor | ||
--- | ||
|
||
Added support for new backend system and full support of `@backtage/integration-aws-node` for session management |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,5 +57,6 @@ | |
"prettier": "@spotify/prettier-config", | ||
"dependencies": { | ||
"@changesets/cli": "^2.18.0" | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
plugins/backend/catalog-backend-module-aws/src/alpha.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/* | ||
* Copyright 2024 Larder Software Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { | ||
coreServices, | ||
createBackendModule, | ||
} from '@backstage/backend-plugin-api'; | ||
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; | ||
import { | ||
AWSLambdaFunctionProvider, | ||
AWSS3BucketProvider, | ||
AWSIAMUserProvider, | ||
AWSDynamoDbTableProvider, | ||
// AWSDynamoDbTableDataProvider, | ||
AWSIAMRoleProvider, | ||
AWSEKSClusterProvider, | ||
AWSEC2Provider, | ||
AWSRDSProvider, | ||
AWSOrganizationAccountsProvider, | ||
} from './providers'; | ||
import { AWSIAMRoleProcessor } from './processors'; | ||
|
||
export default createBackendModule({ | ||
pluginId: 'catalog', | ||
moduleId: 'aws-entity-provider', | ||
register(env) { | ||
env.registerInit({ | ||
deps: { | ||
config: coreServices.rootConfig, | ||
logger: coreServices.logger, | ||
scheduler: coreServices.scheduler, | ||
catalog: catalogProcessingExtensionPoint, | ||
discovery: coreServices.discovery, | ||
}, | ||
async init({ config, logger, scheduler, catalog, discovery }) { | ||
if ( | ||
config.getOptional( | ||
'catalog.processors.awsOrganization.provider.accountId', | ||
) | ||
) { | ||
catalog.addEntityProvider( | ||
AWSOrganizationAccountsProvider.fromConfig( | ||
config.get('catalog.processors.awsOrganization.provider'), | ||
{ logger, scheduler }, | ||
), | ||
); | ||
} | ||
|
||
for (const awsConfig of config.getOptionalConfigArray('aws.accounts') || | ||
[]) { | ||
// Amazon DynamoDB table data | ||
// await catalog.addEntityProvider( | ||
// AWSDynamoDbTableDataProvider.fromConfig(awsConfig, { | ||
// logger, | ||
// scheduler, | ||
// }), | ||
// ); | ||
|
||
// Amazon DynamoDB table | ||
await catalog.addEntityProvider( | ||
AWSDynamoDbTableProvider.fromConfig(awsConfig, { | ||
logger, | ||
scheduler, | ||
}), | ||
); | ||
|
||
// Amazon EKS | ||
await catalog.addEntityProvider( | ||
AWSEKSClusterProvider.fromConfig(awsConfig, { logger, scheduler }), | ||
); | ||
|
||
// Amazon EC2 | ||
await catalog.addEntityProvider( | ||
AWSEC2Provider.fromConfig(awsConfig, { logger, scheduler }), | ||
); | ||
|
||
// AWS Identity and Access Management role | ||
await catalog.addEntityProvider( | ||
AWSIAMRoleProvider.fromConfig(awsConfig, { logger, scheduler }), | ||
); | ||
|
||
// AWS Identity and Access Management user | ||
await catalog.addEntityProvider( | ||
AWSIAMUserProvider.fromConfig(awsConfig, { logger, scheduler }), | ||
); | ||
|
||
// AWS Lambda function | ||
await catalog.addEntityProvider( | ||
AWSLambdaFunctionProvider.fromConfig(awsConfig, { | ||
logger, | ||
scheduler, | ||
}), | ||
); | ||
|
||
// Amazon Relational Database Service (RDS) | ||
await catalog.addEntityProvider( | ||
AWSRDSProvider.fromConfig(awsConfig, { logger, scheduler }), | ||
); | ||
|
||
// Amazon Simple Storage Service (S3) | ||
await catalog.addEntityProvider( | ||
AWSS3BucketProvider.fromConfig(awsConfig, { logger, scheduler }), | ||
); | ||
|
||
await catalog.addProcessor( | ||
AWSIAMRoleProcessor.fromConfig(awsConfig, { logger, discovery }), | ||
); | ||
} | ||
|
||
logger.info('AWS entity providers registered'); | ||
}, | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on! I haven't looked at the rest of modifications yet but this looks like a breaking change so let's make it
major
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Xantier
I'm working to manage backward compatiblity right now, better to turn this PR as draft.