90 lines
5.1 KiB
Markdown
90 lines
5.1 KiB
Markdown
# Best Practices
|
|
|
|
1) Name scheming
|
|
|
|
Nom des resources = <kind>-<app>-<environment>
|
|
|
|
2) Tagging
|
|
|
|
# Providers
|
|
|
|
| Name | Version |
|
|
|---|---|
|
|
| [provider-aws-rds](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1) | 1.2.1 |
|
|
| [provider-aws-iam](https://marketplace.upbound.io/providers/upbound/provider-aws-iam/v1.2.1) | 1.2.1 |
|
|
| [provider-aws-ec2](https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v1.2.1) | 1.2.1 |
|
|
|
|
# CompositeResources
|
|
|
|
| Provider | Kind |
|
|
|---|---|
|
|
| [IAM](https://marketplace.upbound.io/providers/upbound/provider-aws-iam/v1.2.1) | [Role](https://marketplace.upbound.io/providers/upbound/provider-aws-iam/v1.2.1/resources/iam.aws.upbound.io/Role/v1beta1) |
|
|
| [RDS](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1) | [Cluster](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1/resources/rds.aws.upbound.io/Cluster/v1beta1) |
|
|
| [RDS](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1) | [ClusterRoleAssociation](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1/resources/rds.aws.upbound.io/ClusterRoleAssociation/v1beta1) |
|
|
| [RDS](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1) | [SubnetGroup](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1/resources/rds.aws.upbound.io/SubnetGroup/v1beta1) |
|
|
| [RDS](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1) | [ClusterInstance](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1/resources/rds.aws.upbound.io/ClusterInstance/v1beta1) |
|
|
| [RDS](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1) | [Instance](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1/resources/rds.aws.upbound.io/Instance/v1beta2) |
|
|
| [RDS](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1) | [ClusterParameterGroup](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1/resources/rds.aws.upbound.io/ClusterParameterGroup/v1beta1) |
|
|
| [RDS](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1) | [ParameterGroup](https://marketplace.upbound.io/providers/upbound/provider-aws-rds/v1.2.1/resources/rds.aws.upbound.io/ParameterGroup/v1beta1) |
|
|
| [EC2](https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v1.2.1) | [SecurityGroup](https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v1.2.1/resources/ec2.aws.upbound.io/SecurityGroup/v1beta1) |
|
|
| [EC2](https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v1.2.1) | [SecurityGroupRule](https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v1.2.1/resources/ec2.aws.upbound.io/SecurityGroupRule/v1beta1) |
|
|
| [EC2](https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v1.2.1) | [SecurityGroupIngressRule](https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v1.2.1/resources/ec2.aws.upbound.io/SecurityGroupIngressRule/v1beta1) |
|
|
| [EC2](https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v1.2.1) | [SecurityGroupEgressRule](https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v1.2.1/resources/ec2.aws.upbound.io/SecurityGroupEgressRule/v1beta1) |
|
|
|
|
# Claim example
|
|
|
|
```yaml
|
|
apiVersion: crossplane.evina/v1alpha1
|
|
kind: RDS
|
|
metadata:
|
|
namespace: crossplane-system
|
|
name: claimed-
|
|
spec:
|
|
compositionRef:
|
|
name: rds-composition
|
|
parameters:
|
|
region:
|
|
app:
|
|
environment:
|
|
engine:
|
|
```
|
|
|
|
## Inputs
|
|
|
|
| Name | Description | Value |Required |
|
|
|---|---|---|---|
|
|
| region | AWS Region where the provider will operate | eu-west-1 | Required |
|
|
| app | Name of the app (Used for Tagging/Naming) | dcbprotect / karpenter / brandprotect / grafana | Required |
|
|
| environment | Environment where the claim will operate (Used for Tag/Naming) | dev / staging / production | Required |
|
|
| account | Environment where the claim will operate (Used for Tagging) | 169590266381 | Recommended |
|
|
| engineVersion | The engine version to use | 5.7.mysql_aurora.2.11.2 | Required |
|
|
| providerConfigRef | Target a specific account | provider-aws-config.yaml | Required |
|
|
| instanceClass | Instance used to host the database | db.t3.medium | Required |
|
|
|
|
# Outputs
|
|
|
|
# TODO
|
|
|
|
- [x] Import and observe all resources from terraform
|
|
- [ ] Create a managed resources with crossplane
|
|
- [x] IAM
|
|
- [x] Role
|
|
- [x] RDS
|
|
- [ ] Cluster
|
|
- [x] SubnetGroup
|
|
- [ ] ClusterInstance
|
|
- [x] Instance
|
|
- [x] ClusterParameterGroup
|
|
- [x] ParameterGroup
|
|
- [x] EC2
|
|
- [x] SecurityGroup
|
|
- [ ] SecurityGroupRule (Générer une managedResources pour faire le lien entre une compo RDS et APP)
|
|
- [ ] SecurityGroupIngressRule (Générer une managedResources pour faire le lien entre une compo RDS et APP)
|
|
- [x] SecurityGroupEgressRule
|
|
- [ ] Check Tags
|
|
- [ ] Check when to use Refs
|
|
- [ ] How to create more instances from claim
|
|
- [ ] Create a certIdentifier ?
|
|
- [ ] Ajouter une resource roleAssociation for RDS and IAM role created
|
|
- [ ] Ajoute automatiquement la description "Managed by terraform" SubnetGroup ??
|
|
- [ ] Create composition and definition |