Cross Account Smart Software Update Service
Actual a SNS with a json payload is used to trigger crassus. The payload should look like this:
{
"version": 1,
"stackName": "sample-stack",
"region": "<AWS-REGION-ID>",
"parameters": {
"parameter1": "value1",
"parameter2": "value2",
}
}
Sample event as expected from deployer
{
"Records": [
{
"EventVersion": "1.0",
"EventSubscriptionArn": "<SUBSCRIPTION ARN>",
"EventSource": "aws: sns",
"Sns": {
"SignatureVersion": "1",
"Timestamp": "2015-10-23T11: 01: 16.140Z",
"Signature": "<SIGNATURE>",
"SigningCertUrl": "<SIGNING URL>",
"MessageId": "<MESSAGE ID>",
"Message": "{
\"version\": 1,
\"stackName\": \"sample-stack\",
\"region\": \"eu-west-1\",
\"parameters\": {
\"InstanceType\": \"t2.micro\"
}
}",
"MessageAttributes": {
},
"Type": "Notification",
"UnsubscribeUrl": "<UNSUBSCRIBE URL>",
"TopicArn": "<TOPIC ARN>",
"Subject": "None"
}
}
]
}
One possibility to deploy crassus is to use CloudFormation.
To do it the simple way take a look at cfn-sphere
In cfn-sphere
directory you can find the template and configuration file for cfn-sphere usage.
The goal is to have a simple integration test which involves the infrastructure on which CRASSUS is relying and that is represented by the CloudFormation template.
To determine if CRASSUS can successfully update a CloudFormation stack we use the [python-docker-hello-world-webapp] (https://github.com/ImmobilienScout24/python-docker-hello-world-webapp#python-docker-hello-world-webapp) as target application stack.
- Create test role which has only permission to use SNS in the current account
- Create CRASSUS test stack from latest version, authorize the test role to send update messages
- Create target application stack
- Use the test role to send an update message with an updated stack parameter
- Test that the parameter of the target application successfully was successfully updated
- If the test was successful, delete the the target application stack, the test role and the CRASSUS test stack