Skip to content

Commit

Permalink
chore: add a parameter for the api key expiration (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
wooj2 authored Dec 2, 2020
1 parent e62fab2 commit 556f57a
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ Parameters:
MaxLength: 24
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9]*$'

AppSyncApiKeyExpires:
Default: 1638316800
Description: >-
Unix time when the APIKey will expire. Typically you want to do this
364 days in the future. Default value is 12/01/2021 @12:00AM (UTC)
Type: Number

Conditions:
AuthTypeIsAPIKey: !Equals [ !Ref AuthType, ApiKey ]
AuthTypeIsIAM: !Equals [ !Ref AuthType, IAM ]
Expand Down Expand Up @@ -215,10 +222,7 @@ Resources:
Type: AWS::AppSync::ApiKey
Properties:
ApiId: !GetAtt GraphQLApi.ApiId
# Hardcoded, since we don't have an easy way of deriving
# expiration date via a function. Current value:
# 27-Dec-2019
Expires: 1577433600
Expires: !Sub ${AppSyncApiKeyExpires}

#########################################################
# AppSync IAM Auth resources
Expand Down

0 comments on commit 556f57a

Please sign in to comment.