Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

AWS instances not recreated #205

Open
waldner opened this issue Jun 2, 2022 · 0 comments
Open

AWS instances not recreated #205

waldner opened this issue Jun 2, 2022 · 0 comments

Comments

@waldner
Copy link

waldner commented Jun 2, 2022

Crossplane 1.8.1, jet-aws provider 0.4.2,

I wanted to test the convergence behavior, so I created an AWS instance with the following YAML:

apiVersion: ec2.aws.jet.crossplane.io/v1alpha2
kind: Instance
metadata:
  name: crossplane-instance
spec:
  forProvider:
    region: eu-west-1
    ami: ami-0a10fe11f3e1bf41e
    instanceType: t2.micro
    keyName: mykey
  providerConfigRef:
    name: aws-provider-config

The creation was fine. I terminated the instance from the AWS console, and crossplane doesn't recreate it with this error:

    - lastTransitionTime: "2022-06-02T11:45:18Z"
      message: 'create failed: cannot apply: apply failed: error collecting instance settings: error creating resource: iops attribute not supported for root_block_device with volume_type gp2: : File name: main.tf.json'
      reason: ReconcileError
      status: "False"
      type: Synced

Indeed, main.tf.json has the following:

"root_block_device":[{"iops":100,"volume_size":10,"volume_type":"gp2"}]

and the Instance spec also:

      rootBlockDevice:
      - iops: 100
        volumeSize: 10
        volumeType: gp2

so it looks like it was incorrectly backfilled after creation? Any help appreciated.

EDIT: After manually edit the Instance YAML and removing the rootBlockDevice from the spec, crossplane now fails with:

      message: "create failed: cannot apply: apply failed: Error launching source instance: UnsupportedOperation: The t2.micro instance type does not support specifying CpuOptions.\n\tstatus code: 400, request id: 9a1ada5a-17cb-4e46-9729-fe43a1d25031: : File name: main.tf.json"

After removing the CPU options from the YAML, the instance was finally recreated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant