-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(aws/cloudformation): Add cloudformation controller #3279
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
feat(aws/cloudformation): Add cloudformation controller #3279
Conversation
This API will be used by Orca to query the status of a cloudformation deploy operation asynchronously. It uses the cloud formation provider to access the cached value by the cloudformation caching agent. Signed-off-by: Xavi León <xavi.leon@schibsted.com>
We prefer that non-test backend code be written in Java or Kotlin, rather than Groovy. The following files have been added and written in Groovy:
See our server-side commit conventions here. |
Signed-off-by: Xavi León <xavi.leon@schibsted.com>
c76d468
to
04c20e9
Compare
} catch (NoSuchElementException e) { | ||
throw new ResourceNotFoundException("Cloud Formation stackId $stackId not found.") | ||
} | ||
log.debug("Cloud formation get stack with id $stackId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.debug("Cloud formation get stack with id {}", stackId);
it.list(accountId, region) | ||
}.flatten() | ||
@RequestParam(required = false, defaultValue = "*") String region) { | ||
log.debug("Cloud formation list stacks for account $accountId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.debug("Cloud formation list stacks for account {}", accountId);
.filter(Optional::isPresent) | ||
.map(Optional<CloudFormation>::get) | ||
.findFirst() | ||
.<ResourceNotFoundException>orElseThrow(() -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the generic stuff here, just do .orElseThrow(() -> {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or never mind, I'm wrong :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just do this? orElseThrow(() -> new ResourceNotFoundException("..."));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Done in 1e91224
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.data.rest.webmvc.ResourceNotFoundException; | ||
import org.springframework.web.bind.annotation.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd split this into separate imports
Signed-off-by: Xavi León <xavi.leon@schibsted.com>
This patch introduces the CloudFormation stage to deploy CloudFormation templates. The stage basically consists of two main tasks: 1. an async task sent through `kato service` to clouddriver to deploy the cloud formation template. 2. an task that waits for the completion of the deploy task by asking cloud driver via its CloudFormation API. The stage can be configured right now by specifying a json with the following spec: { stackName: name of the stack to be deployed region: region where the stack is to be deployed template: cloud formation template json parameters: json with the parameters that will be used by the template. } Related issue: spinnaker/spinnaker#736 Related PRs: spinnaker/clouddriver#3278 spinnaker/clouddriver#3279 spinnaker/clouddriver#3280 Signed-off-by: Xavi León <xavi.leon@schibsted.com>
This patch introduces the CloudFormation stage to deploy CloudFormation templates. The stage basically consists of two main tasks: 1. an async task sent through `kato service` to clouddriver to deploy the cloud formation template. 2. an task that waits for the completion of the deploy task by asking cloud driver via its CloudFormation API. The stage can be configured right now by specifying a json with the following spec: ``` { stackName: name of the stack to be deployed region: region where the stack is to be deployed template: cloud formation template json parameters: json with the parameters that will be used by the template. } ``` Related issue: spinnaker/spinnaker#736 Related PRs: spinnaker/clouddriver#3278 spinnaker/clouddriver#3279 spinnaker/clouddriver#3280 Signed-off-by: Xavi León <xavi.leon@schibsted.com>
This patch introduces the CloudFormation stage to deploy CloudFormation templates. The stage basically consists of two main tasks: 1. an async task sent through `kato service` to clouddriver to deploy the cloud formation template. 2. an task that waits for the completion of the deploy task by asking cloud driver via its CloudFormation API. The stage can be configured right now by specifying a json with the following spec: ``` { stackName: name of the stack to be deployed region: region where the stack is to be deployed template: cloud formation template json parameters: json with the parameters that will be used by the template. } ``` Related issue: spinnaker/spinnaker#736 Related PRs: spinnaker/clouddriver#3278 spinnaker/clouddriver#3279 spinnaker/clouddriver#3280 Signed-off-by: Xavi León <xavi.leon@schibsted.com>
Signed-off-by: Xavi León <xavi.leon@schibsted.com>
Signed-off-by: Xavi León <xavi.leon@schibsted.com>
This patch introduces the CloudFormation stage to deploy CloudFormation templates. The stage basically consists of two main tasks: 1. an async task sent through `kato service` to clouddriver to deploy the cloud formation template. 2. an task that waits for the completion of the deploy task by asking cloud driver via its CloudFormation API. The stage can be configured right now by specifying a json with the following spec: ``` { stackName: name of the stack to be deployed region: region where the stack is to be deployed template: cloud formation template json parameters: json with the parameters that will be used by the template. } ``` Related issue: spinnaker/spinnaker#736 Related PRs: spinnaker/clouddriver#3278 spinnaker/clouddriver#3279 spinnaker/clouddriver#3280 Signed-off-by: Xavi León <xavi.leon@schibsted.com>
This patch introduces the CloudFormation stage to deploy CloudFormation templates. The stage basically consists of two main tasks: 1. an async task sent through `kato service` to clouddriver to deploy the cloud formation template. 2. an task that waits for the completion of the deploy task by asking cloud driver via its CloudFormation API. The stage can be configured right now by specifying a json with the following spec: ``` { stackName: name of the stack to be deployed region: region where the stack is to be deployed template: cloud formation template json parameters: json with the parameters that will be used by the template. } ``` Related issue: spinnaker/spinnaker#736 Related PRs: spinnaker/clouddriver#3278 spinnaker/clouddriver#3279 spinnaker/clouddriver#3280 Signed-off-by: Xavi León <xavi.leon@schibsted.com>
This API will be used by Orca to query the status of a cloudformation
deploy operation asynchronously. It uses the cloud formation provider
to access the cached value by the cloudformation caching agent.
This PR partly addresses spinnaker/spinnaker#736 and depends on #3278
Signed-off-by: Xavi León xavi.leon@schibsted.com