Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Requirement 4 abac #72

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
all: backend frontend-build

TEMPLATES = auth product-mock shoppingcart-service
TEMPLATES = auth product-mock discounted-product-mock shoppingcart-service

REGION := $(shell python3 -c 'import boto3; print(boto3.Session().region_name)')
ifndef S3_BUCKET
Expand All @@ -12,11 +12,13 @@ endif
backend: create-bucket
$(MAKE) -C backend TEMPLATE=auth S3_BUCKET=$(S3_BUCKET)
$(MAKE) -C backend TEMPLATE=product-mock S3_BUCKET=$(S3_BUCKET)
$(MAKE) -C backend TEMPLATE=discounted-product-mock S3_BUCKET=$(S3_BUCKET)
$(MAKE) -C backend TEMPLATE=shoppingcart-service S3_BUCKET=$(S3_BUCKET)

backend-delete:
$(MAKE) -C backend delete TEMPLATE=auth
$(MAKE) -C backend delete TEMPLATE=product-mock
$(MAKE) -C backend delete TEMPLATE=discounted-product-mock
$(MAKE) -C backend delete TEMPLATE=shoppingcart-service

backend-tests:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ make backend-delete

## Option 2 - Automatically deploy backend and frontend using Amplify Console


[![One-click deployment](https://oneclick.amplifyapp.com/button.svg)](https://console.aws.amazon.com/amplify/home#/deploy?repo=https://github.com/aws-samples/aws-serverless-shopping-cart)
[![One-click deployment](https://oneclick.amplifyapp.com/button.svg)](https://console.aws.amazon.com/amplify/home#/deploy?repo=https://github.com/Pigius/aws-serverless-shopping-cart
)

1) Use **1-click deployment** button above, and continue by clicking "Connect to Github"
2) If you don't have an IAM Service Role with admin permissions, select "Create new role". Otherwise proceed to step 5)
Expand Down
21 changes: 17 additions & 4 deletions backend/auth.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
AWSTemplateFormatVersion: '2010-09-09'
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
auth-resources

SAM Template for auth resources


Globals:
Function:
Timeout: 3
Expand All @@ -15,8 +14,22 @@ Resources:
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: !Sub ${AWS::StackName}-UserPool
AutoVerifiedAttributes:
AutoVerifiedAttributes:
- email
Schema:
- Name: email
AttributeDataType: String
Mutable: false
Required: true
- Name: role
AttributeDataType: String
Mutable: true
Required: false
- Name: yearsAsMember
AttributeDataType: Number
Mutable: true
Required: false

UserPoolClient:
Type: AWS::Cognito::UserPoolClient
Properties:
Expand Down Expand Up @@ -54,4 +67,4 @@ Outputs:

CognitoAppClientId:
Description: "Cognito App Client ID"
Value: !Ref UserPoolClient
Value: !Ref UserPoolClient
Empty file.
Loading