This commit is contained in:
Guillaume Destuynder 2018-10-19 11:29:26 -07:00
Родитель 998bd3f27f
Коммит f32f99a54b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 956347F6FBF3A415
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -3,7 +3,8 @@ PARENTDIR := $(realpath ../)
IMAGE_NAME := mozdef-deployment IMAGE_NAME := mozdef-deployment
STACK_NAME := mozdef-aws-nested STACK_NAME := mozdef-aws-nested
# MozDef uses a nested CF stack, the mozdef-parent.yml will tie all child stacks together and load them from S3 # MozDef uses a nested CF stack, the mozdef-parent.yml will tie all child stacks together and load them from S3
S3_BUCKET_URI := s3://mozdef.infosec.mozilla.org/cf S3_BUCKET_NAME := cf
S3_BUCKET_URI := s3://mozdef.infosec.mozilla.org/$(S3_BUCKET_NAME)
S3_STACK_URI := https://s3-us-west-2.amazonaws.com/mozdef.infosec.mozilla.org/cf/mozdef-parent.yml S3_STACK_URI := https://s3-us-west-2.amazonaws.com/mozdef.infosec.mozilla.org/cf/mozdef-parent.yml
DOCKER_BASH_RUN := docker run -v ~/.aws:/root/.aws -v `pwd`:/opt/mozdef $(IMAGE_NAME):latest /bin/bash -c DOCKER_BASH_RUN := docker run -v ~/.aws:/root/.aws -v `pwd`:/opt/mozdef $(IMAGE_NAME):latest /bin/bash -c
@ -26,13 +27,13 @@ packer-build: docker-build ## Build the base AMI with packer
$(DOCKER_BASH_RUN) "cd packer && packer build packer.json" $(DOCKER_BASH_RUN) "cd packer && packer build packer.json"
.PHONY: create-nested-stack create-s3-bucket .PHONY: create-nested-stack create-s3-bucket
create-nested-stack: upload-templates test ## Create everything you need for a fresh new stack! create-nested-stack: test ## Create everything you need for a fresh new stack!
$(DOCKER_BASH_RUN) "aws cloudformation create-stack --stack-name $(STACK_NAME) --template-url $(S3_STACK_URI)" $(DOCKER_BASH_RUN) "aws cloudformation create-stack --stack-name $(STACK_NAME) --template-url $(S3_STACK_URI)"
create-s3-bucket: create-s3-bucket:
$(DOCKER_BASH_RUN) "aws s3api create-bucket --bucket $(S3_BUCKET_URI) --acl public-read" $(DOCKER_BASH_RUN) "aws s3api create-bucket --bucket $(S3_BUCKET_NAME) --acl public-read"
.PHONY: updated-nested-stack .PHONY: updated-nested-stack
update-nested-stack: upload-templates test ## Updates the nested stack on AWS update-nested-stack: test ## Updates the nested stack on AWS
$(DOCKER_BASH_RUN) "aws cloudformation update-stack --stack-name $(STACK_NAME) --template-url $(S3_STACK_URI)" $(DOCKER_BASH_RUN) "aws cloudformation update-stack --stack-name $(STACK_NAME) --template-url $(S3_STACK_URI)"
.PHONY: cflint test .PHONY: cflint test