Skip to content

Commit

Permalink
Merge pull request #1 from christopherhein/chore/additional-validatio…
Browse files Browse the repository at this point in the history
…n-methods

Adding validation method using DNS
  • Loading branch information
christopherhein authored Dec 4, 2019
2 parents 3043766 + 001917c commit e7d1d17
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
TEMPLATE=dist/aws-ecr-public.template.json
TEMPLATE ?= dist/aws-ecr-public.template.json
STACK_NAME ?= aws-ecr-public
VALIDATION_DOMAIN ?= ""
DOMAIN_NAME ?= ""
VALIDATION_METHOD ?= "EMAIL"


build:
mkdir -p dist
cfn-include -t -m serverless.template.yml > $(TEMPLATE)

test: build
aws cloudformation deploy --template-file $(TEMPLATE) --stack-name aws-ecr-public --capabilities CAPABILITY_IAM
aws cloudformation deploy \
--template-file $(TEMPLATE) \
--stack-name $(STACK_NAME) \
--capabilities CAPABILITY_IAM \
--parameter-overrides \
ValidationDomain=$(VALIDATION_DOMAIN) \
DomainName=$(DOMAIN_NAME) \
ValidationMethod=$(VALIDATION_METHOD)

clean:
rm -rf dist
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ If you would like to make your registries publicly available then this solution
| -- | -- | -- |
| DomainName | No | If provided an ACM Certificate and API Domain Name will be created
| ValidationDomain | No | Overwrite default Validation Domain for ACM Certificate
| ValidationMethod | Yes, *Default: EMAIL* | Allow you to use DNS instead of EMAIL for Certificate validation

## FAQ

Expand Down
6 changes: 6 additions & 0 deletions serverless.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Parameters:
Type: String
Default: ''
Description: If provided an ACM Certificate and API Domain Name will be created
ValidationMethod:
Type: String
Default: 'EMAIL'
AllowedValues: ["EMAIL", "DNS"]
Description: If provided an ACM Certificate and API Domain Name will be created

Conditions:
HasValidationDomain: !Not [ !Equals [ !Ref ValidationDomain, '' ] ]
Expand Down Expand Up @@ -76,6 +81,7 @@ Resources:
Condition: HasDomainName
Properties:
DomainName: !Ref DomainName
ValidationMethod: !Ref ValidationMethod
DomainValidationOptions:
Fn::If:
- HasValidationDomain
Expand Down

0 comments on commit e7d1d17

Please sign in to comment.