awslabs / crossplane-on-eks

Crossplane bespoke composition blueprints for AWS resources
Apache License 2.0
308 stars 109 forks source link

feat: adding upbound aws and helm providers #96

Closed candonov closed 1 year ago

candonov commented 1 year ago

What does this PR do?

Adds installation for helm-provider and upbound-aws-provider.

Motivation

Resolves: https://github.com/awslabs/crossplane-on-eks/issues/9

More

For Moderators

Additional Notes

Tested upbound aws-provider by successfully creating an S3 bucket:

cat <<EOF | kubectl create -f -
apiVersion: s3.aws.upbound.io/v1beta1
kind: Bucket
metadata:
  generateName: test-bucket-
spec:
  forProvider:
    region: us-east-1
  providerConfigRef:
    name: aws-provider-config
EOF

Tested helm provider by successfully creating a helm release:

cat <<EOF | kubectl create -f -
apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
  name: hello-example
spec:
  forProvider:
    chart:
      name: hello
      repository: https://cloudecho.github.io/charts
      version: 0.1.2
    namespace: hello-example
EOF
csantanapr commented 1 year ago

Want to delete the values.yaml file not being used?

csantanapr commented 1 year ago

Trying it now and reading the README.md

It has:

export AWS_REGION=<ENTER YOUR REGION> 
terraform plan

I think it should be:

export TF_VAR_region=<ENTER YOUR REGION>
terraform plan 
candonov commented 1 year ago

Terraform aws provider is OK with AWS_REGION environment variable: https://registry.terraform.io/providers/hashicorp/aws/latest/docs#environment-variables

csantanapr commented 1 year ago

Terraform aws provider is OK with AWS_REGION environment variable: https://registry.terraform.io/providers/hashicorp/aws/latest/docs#environment-variables

I understand but the order is "Parameters in the provider configuration" then "Environment variables"

Configuration for the AWS Provider can be derived from several sources, which are applied in the following order:

  1. Parameters in the provider configuration
  2. Environment variables
  3. Shared credentials files
  4. Shared configuration files
  5. Container credentials
  6. Instance profile credentials and region

And we configure Parameters in the provider configuration with a default value of us-east-1 here: https://github.com/awslabs/crossplane-on-eks/blob/main/bootstrap/terraform/main.tf#L4-L6

I think this is something we can fix in another PR if you want

candonov commented 1 year ago

Terraform aws provider is OK with AWS_REGION environment variable: https://registry.terraform.io/providers/hashicorp/aws/latest/docs#environment-variables

I understand but the order is "Parameters in the provider configuration" then "Environment variables"

Configuration for the AWS Provider can be derived from several sources, which are applied in the following order:

  1. Parameters in the provider configuration
  2. Environment variables
  3. Shared credentials files
  4. Shared configuration files
  5. Container credentials
  6. Instance profile credentials and region

And we configure Parameters in the provider configuration with a default value of us-east-1 here: https://github.com/awslabs/crossplane-on-eks/blob/main/bootstrap/terraform/main.tf#L4-L6

I think this is something we can fix in another PR if you want

Oh, thank you! I didn't realize the var will take precedence. I will fix it here.