This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Facter.add(:ec2_availability_zone) do | |
setcode do | |
Facter::Core::Execution.exec('curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone') | |
end | |
end | |
Facter.add(:aws_region) do | |
setcode do | |
az = Facter.value(:ec2_availability_zone) | |
az[0..-2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get package updates | |
sudo yum update -y | |
# Check if docker installed | |
installed=`yum list installed | grep docker` | |
if [[ -z "${installed}" ]]; then | |
# Docker install steps required for AMI (Amazon Linux) | |
sudo yum install docker -y | |
sudo service docker start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AWS provides a JMS library for SQS: https://aws.amazon.com/blogs/developer/using-amazon-sqs-with-spring-boot-and-spring-jms/ | |
// I wanted to use that setup in a Spring Boot app, and to run some tests against an in-memory | |
// ElasticMQ queue, which is SQS (and AWS Java SDK) compatible. In case your scenario is EXACTLY like mine ... here you go | |
@RunWith(SpringRunner.class) | |
@SpringBootTest | |
// This annotation is important: Forces the Application Context (and SQS connections) to reset between tests. ElasticMQ will fail to | |
// stop if there are active connections. | |
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) | |
public class ApplicationTests { |
OlderNewer