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
StackAlarmTopic: | |
Type: AWS::SNS::Topic | |
Properties: | |
DisplayName: Stack Alarm Topic | |
DatabasePrimaryCPUAlarm: | |
Type: AWS::CloudWatch::Alarm | |
Properties: | |
AlarmDescription: Primary database CPU utilization is over 80%. | |
Namespace: AWS/RDS |
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
DatabaseReplicaInstance: | |
Type: AWS::RDS::DBInstance | |
DependsOn: DatabasePrimaryInstance | |
Properties: | |
Engine: aurora | |
DBClusterIdentifier: !Ref DatabaseCluster | |
DBInstanceClass: !Ref DatabaseInstanceType | |
DBSubnetGroupName: !Ref DatabaseSubnetGroup |
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
Elasticsearch: | |
Type: AWS::Elasticsearch::Domain | |
Properties: | |
DomainName: !Sub ${AWS::StackName}-es | |
ElasticsearchVersion: 5.5 | |
ElasticsearchClusterConfig: | |
InstanceType: t2.small.elasticsearch | |
ZoneAwarenessEnabled: false | |
InstanceCount: 1 | |
EBSOptions: |
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
* * * * * root . /etc/cron.d/project_env.sh ; /usr/local/bin/php /var/www/html/artisan schedule:run &> /var/log/cron.log | |
# An empty line is required at the end of this file for a valid cron file. | |
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
# The worker containers simply execute the Laravel artisan queue:work | |
# command instead of php-fpm | |
TaskDefinitionWorker: | |
Type: AWS::ECS::TaskDefinition | |
Properties: | |
Family: laravel-workers | |
ContainerDefinitions: | |
- Name: app | |
Essential: true | |
Image: !Join [ ".", [ !Ref "AWS::AccountId", "dkr.ecr", !Ref "AWS::Region", !Join [ ":", [ !Join [ "/", [ "amazonaws.com", !Ref ECR ] ], "laravel" ] ] ] ] |
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
# That's all it takes to create a queue in CloudFormation | |
# CloudFormation will assign a unique name to it, that we | |
# will pass to our Laravel containers | |
Queue: | |
Type: AWS::SQS::Queue | |
# Then in the web.yaml stack, we update our ECSRole to grant | |
# our ECS instances access to this one queue we just created | |
- PolicyName: sqs-read-write-access | |
PolicyDocument: |
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
location ~ \.php$ { | |
root /var/www/html/public; | |
fastcgi_cache cache_key; | |
fastcgi_cache_valid 200 204 1m; | |
fastcgi_ignore_headers Cache-Control; | |
fastcgi_no_cache $http_authorization $cookie_laravel_session; | |
fastcgi_cache_lock on; | |
fastcgi_cache_lock_timeout 10s; | |
add_header X-Proxy-Cache $upstream_cache_status; |
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
# Add an ALIAS record to ELB URL | |
aws route53 change-resource-record-sets | |
--hosted-zone-id /hostedzone/YOUR_HOSTED_ZONE_ID | |
--change-batch '{ | |
"Changes":[ | |
{ | |
"Action":"CREATE", | |
"ResourceRecordSet":{ | |
"Name":"files.laravelaws.com.", | |
"Type":"A", |
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 cloudfront create-cloud-front-origin-access-identity | |
--cloud-front-origin-access-identity-config CallerReference=random_string_here,Comment= |
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
CloudFrontDistribution: | |
Type: AWS::CloudFront::Distribution | |
Properties: | |
DistributionConfig: | |
Origins: | |
- DomainName: !Ref S3BucketDNSName | |
Id: myS3Origin | |
S3OriginConfig: | |
OriginAccessIdentity: !Ref CloudFrontOAI | |
Enabled: 'true' |