Skip to content

Error creating AWS control RecordSet #1225

@pyrossh

Description

@pyrossh

Hi,
Thanks for the amazing library. Much easier to work with then terraform. I ran into this bug when I ported my terraform code to alchemy.
It fails when trying to create a hosted zone record set. I'm using "alchemy": "^0.78.0",

Code to the entire alchemy file:
https://pyrossh.dev/repos/website/files/alchemy.run.ts

import AWS from "alchemy/aws/control";

const aRecordDomain = await AWS.Route53.RecordSet("a-record-domain", {
  HostedZoneId: hostedZone.Id,
  Name: domainName,
  Type: "A",
  AliasTarget: {
    DNSName: s3Distribution.DomainName,
    HostedZoneId: s3Distribution.DomainName, // CloudFront hosted zone ID
    EvaluateTargetHealth: false
  }
});

Error,

ERROR Scope failed prd
399 |             throw new ThrottlingException(response, data);
400 |           }
401 |           if (data.__type === "com.amazon.coral.validate#ValidationException") {
402 |             throw new ValidationException(response, data);
403 |           }
404 |           throw new RequestError(response, data);
                          ^
error: Bad Request
 response: Response (0 KB) {
  ok: false,
  url: "https://cloudcontrolapi.ap-south-1.amazonaws.com/?Action=CreateResource&Version=2021-09-30",
  status: 400,
  statusText: "Bad Request",
  headers: Headers {
    "date": "Sun, 23 Nov 2025 12:28:29 GMT",
    "content-type": "application/x-amz-json-1.0",
    "content-length": "147",
    "connection": "keep-alive",
    "x-amzn-requestid": "29d98c79-74ea-4ee0-8ae2-169ca6617eff",
  },
  redirected: false,
  bodyUsed: true
},
     data: {
  __type: "com.amazon.cloudapiservice#UnsupportedActionException",
  Message: "Resource type AWS::Route53::RecordSet does not support CREATE action",
},

State

{
  "kind": "AWS::Route53::RecordSet",
  "id": "a-record-domain",
  "fqn": "prd/a-record-domain",
  "seq": 9,
  "status": "creating",
  "data": {},
  "output": {
    "Symbol(alchemy::ResourceID)": "a-record-domain",
    "Symbol(alchemy::ResourceFQN)": "prd/a-record-domain",
    "Symbol(alchemy::ResourceKind)": "AWS::Route53::RecordSet",
    "Symbol(alchemy::ResourceScope)": {
      "@scope": null
    },
    "Symbol(alchemy::ResourceSeq)": 9,
    "Symbol(alchemy::DestroyStrategy)": "sequential"
  },
  "props": {
    "HostedZoneId": "Z06277131L62Y66EGXAWH",
    "Name": "pyrossh.dev",
    "Type": "A",
    "AliasTarget": {
      "DNSName": "dydxeqxbrvlcu.cloudfront.net",
      "HostedZoneId": "dydxeqxbrvlcu.cloudfront.net",
      "EvaluateTargetHealth": false
    }
  },
  "oldProps": {
    "HostedZoneId": "Z06277131L62Y66EGXAWH",
    "Name": "pyrossh.dev",
    "Type": "A",
    "AliasTarget": {
      "DNSName": "dydxeqxbrvlcu.cloudfront.net",
      "HostedZoneId": "dydxeqxbrvlcu.cloudfront.net",
      "EvaluateTargetHealth": false
    }
  }
}

Seems like the API supports only UPSERT action I guess. Any clues on what could be the issue. I tried looking at the code to figure out a fix if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions