-
Notifications
You must be signed in to change notification settings - Fork 54
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
[cna] schema for CNA external resources #355
Open
geoberle
wants to merge
8
commits into
main
Choose a base branch
from
cna-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
geoberle
force-pushed
the
cna-integration
branch
from
December 9, 2022 10:54
9a80807
to
806b35a
Compare
geoberle
force-pushed
the
cna-integration
branch
from
December 13, 2022 14:06
806b35a
to
d5200d2
Compare
temporarily add support for the `example-aws-assumerole` CNA type. ``` - provider: aws-assume-role identifier: test aws_assume_role: slug: test account: $ref: /aws/some-acc/account.yml ``` the role ARNs this and other kinds require, are stored in the `/aws/account-1.yml` schema. a default role ARN can be defined but module specific ones are supported as well. while we iterate we might drop support for the defaultRoleARN or revamp the way of providing module/context specific default parameters ``` --- $schema: /aws/account-1.yml cna: defaultRoleARN: arn:aws:iam::xxx:role/RH-CNA moduleRoleARNS: - module: aws-rds arn: arn:aws:iam::xxx:role/RH-CNA-RDS ``` Signed-off-by: Gerd Oberlechner <[email protected]>
* CNA aws-rds provider ``` - provider: aws-rds identifier: cna-test-rds vpc: $ref: /aws/acc/vpcs/vpc.yml default: /path/to/default.yml override: db_subnet_group_name: default ``` Signed-off-by: Gerd Oberlechner <[email protected]>
* override and default schema represented by same schema objects all CNA assets must have a `defaults` and an `overrides` section, as a lot of the terraform-resources do. the difference is, that each CNA type declares a special `XXXConfig_v1` type that is used for both fields. ```yaml name: CNARDSInstance_v1 interface: CNAsset_v1 fields: - { name: provider, type: string, isRequired: true } - { name: identifier, type: string, isRequired: true, isUnique: true } - { name: name, type: string } - { name: defaults, type: CNARDSInstanceConfig_v1 } <-- - { name: overrides, type: CNARDSInstanceConfig_v1 } <-- ``` having defaults following a strict schema and overrides being able to override all of the defaults, makes writing testable and verifiable code a lot easier.
revert experiment where overrides and defaults are exactly the same schema. the result was that all fields in overrides and defaults needed to be optional so they can be used in both places without making overrides mandatory. in this PR, overrides are now all optional, follow a schema in jsonschema but none in GQL where they are just JSON
Signed-off-by: Gerd Oberlechner <[email protected]>
geoberle
force-pushed
the
cna-integration
branch
from
December 20, 2022 13:16
459238a
to
d732b38
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
this schema change introduces the external-resources extension for CNA
it covers the following modules
null
- for simple testing purposes without any prereqs on AWS accounts or clusters etc.aws-assume-role
- for testing AWS assume-role access by CNAaws-rds
- create an AWS RDS databasecna-experimental
services as the provider, indicating the experimental nature of the integration and theCNAExperimentalProvisioner_v1
serves as the provisioner, wrapping an OCM organization and potentially adding additional config data (we will add a API URL override to this soon so we can target CNA API instances living outside of api.openshift.com)Provisioner
Example RDS
The defaults files for CNA are now datafile schemas as well. As such they enable us to use references, e.g. a VPC
Here is the example of a defaults file for a production DB
and the external resource declaration that leverages it
design doc: https://gitlab.cee.redhat.com/service/app-interface/-/merge_requests/53097
ref: https://issues.redhat.com/browse/APPSRE-6295