Skip to content
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

Updated CloudFormation templates #241

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions extra/cloudformation/default-unauth-resources-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,17 @@ Resources:
responseData = {Error: "describeEndpoint call failed"};
console.log(responseData.Error + ":\n", err);
} else {
const splitEndpointAddress = data.endpointAddress.split(".");
const endpointAddress = !splitEndpointAddress[0].endsWith("-ats")
? `${splitEndpointAddress[0]}-ats.${splitEndpointAddress
.splice(1)
.join(".")}`
: data.endpointAddress;
Comment on lines +701 to +706
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, looking at this further, I don't understand the logic here. From the IoT docs, it seems like the "-ats" is distinguishing between Verisign-signed and ATS-signed endpoints: https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeEndpoint.html . If the goal is to always have ats-signed endpoints, shouldn't this be passing in endpointType = iot:Data-ATS? I'm not sure it's guaranteed that you can take a Verisign-signed endpoint and just tack "-ats" at the end to get an ATS-signed endpoint.

Copy link
Collaborator

@its-aazizi its-aazizi Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbalfour-amzn closing this, raised another PR that is updated with main, and that PR resolves your above comment.

responseStatus = "SUCCESS";
responseData = {
IotEndpointAddress: data.endpointAddress,
IotEndpointAddress: endpointAddress,
};
console.log(
"response data: " + JSON.stringify(responseData)
);
console.log("response data: " + JSON.stringify(responseData));
}

sendResponse(event, context, responseStatus, responseData);
Expand Down
12 changes: 8 additions & 4 deletions extra/cloudformation/main-cf-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,17 @@ Resources:
responseData = {Error: "describeEndpoint call failed"};
console.log(responseData.Error + ":\n", err);
} else {
const splitEndpointAddress = data.endpointAddress.split(".");
const endpointAddress = !splitEndpointAddress[0].endsWith("-ats")
? `${splitEndpointAddress[0]}-ats.${splitEndpointAddress
.splice(1)
.join(".")}`
: data.endpointAddress;
responseStatus = "SUCCESS";
responseData = {
IotEndpointAddress: data.endpointAddress,
IotEndpointAddress: endpointAddress,
};
console.log(
"response data: " + JSON.stringify(responseData)
);
console.log("response data: " + JSON.stringify(responseData));
}

sendResponse(event, context, responseStatus, responseData);
Expand Down
Loading