Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Production doc builds - 2021/10/12 00:16:19 UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-ia-ci committed Oct 12, 2021
1 parent 7e9ed2a commit 7e12941
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 247 deletions.
2 changes: 1 addition & 1 deletion docs/boilerplate
4 changes: 1 addition & 3 deletions docs/generated/parameters/index.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@

=== Parameters for launching stack creation
include::lex_bot_kendra_master.template.adoc[]
// placeholder
20 changes: 1 addition & 19 deletions docs/generated/services/metadata.adoc
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@

:template_aws_cloudformation_stack:
:template_aws_iam_policy:
:template_aws_iam_role:
:template_aws_iam_servicelinkedrole:
:template_aws_lambda_function:
:template_aws_lambda_layerversion:
:template_aws_lambda_permission:
:template_aws_s3_bucket:
:template_cloudformation:
:template_copyzips:
:template_custom_copyzips:
:template_custom_kendracustomresource:
:template_custom_lexbotopsfunctiontrigger:
:template_iam:
:template_kendracustomresource:
:template_lambda:
:template_lexbotopsfunctiontrigger:
:template_s3:
// placeholder
242 changes: 63 additions & 179 deletions index.html

Large diffs are not rendered by default.

25 changes: 15 additions & 10 deletions templates/kendra_resource.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,35 @@ Resources:
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource:
- arn:aws:logs:*:*:*
!Sub "arn:${AWS::Partition}:logs:*:*:*"
- Effect: Allow
Action:
- "s3:GetObject"
- "s3:ListBucket"
- "s3:HeadBucket"
Resource:
- !Sub "arn:aws:s3:::${ArtifactsS3BucketName}"
- "arn:aws:s3:*:*:accesspoint/*"
- !Sub "arn:aws:s3:::${ArtifactsS3BucketName}/*"
- !Sub "arn:aws:s3:::${KendraS3BucketName}"
- !Sub "arn:aws:s3:::${KendraS3BucketName}/*"
- !Sub "arn:${AWS::Partition}:s3:::${ArtifactsS3BucketName}"
- !Sub "arn:${AWS::Partition}:s3:::${ArtifactsS3BucketName}/*"
- !Sub "arn:${AWS::Partition}:s3:::${KendraS3BucketName}"
- !Sub "arn:${AWS::Partition}:s3:::${KendraS3BucketName}/*"
- Effect: Allow
Action:
- "kendra:CreateIndex"
Resource:
- "*"
- Effect: Allow
Action:
- "kendra:DeleteIndex"
- "kendra:CreateDataSource"
- "kendra:DescribeIndex"
- "kendra:CreateIndex"
- "kendra:StartDataSourceSyncJob"
- "kendra:CreateFaq"
- "kendra:TagResource"
- "kendra:UntagResource"
Resource:
- "*"
- !Sub "arn:${AWS::Partition}:kendra:${AWS::Region}:${AWS::AccountId}:index/*"
- !Sub "arn:${AWS::Partition}:kendra:${AWS::Region}:${AWS::AccountId}:index/*/data-source/*"
- !Sub "arn:${AWS::Partition}:kendra:${AWS::Region}:${AWS::AccountId}:index/*/faq/*"
- Effect: Allow
Action:
- "iam:GetRole"
Expand All @@ -116,15 +121,15 @@ Resources:
- "lambda:AddPermission"
- "lambda:RemovePermission"
Resource:
- "*"
- !Sub "arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:*"
- Effect: Allow
Action:
- "events:PutRule"
- "events:DeleteRule"
- "events:PutTargets"
- "events:RemoveTargets"
Resource:
- "*"
- !Sub "arn:${AWS::Partition}:events:${AWS::Region}:${AWS::AccountId}:rule/*"

KendraOperationsFunction:
DependsOn:
Expand Down
28 changes: 19 additions & 9 deletions templates/lambda_kendra_search.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,17 @@ Resources:
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource:
- arn:aws:logs:*:*:*
- !Sub "arn:${AWS::Partition}:logs:*:*:*"
- Effect: Allow
Action:
- "s3:GetObject"
- "s3:ListBucket"
- "s3:HeadBucket"
Resource:
- !Sub "arn:aws:s3:::${ArtifactsS3BucketName}"
- "arn:aws:s3:*:*:accesspoint/*"
- !Sub "arn:aws:s3:::${ArtifactsS3BucketName}/*"
- !Sub "arn:aws:s3:::${KendraS3BucketName}"
- !Sub "arn:aws:s3:::${KendraS3BucketName}/*"
- !Sub "arn:${AWS::Partition}:s3:::${ArtifactsS3BucketName}"
- !Sub "arn:${AWS::Partition}:s3:::${ArtifactsS3BucketName}/*"
- !Sub "arn:${AWS::Partition}:s3:::${KendraS3BucketName}"
- !Sub "arn:${AWS::Partition}:s3:::${KendraS3BucketName}/*"
- Effect: Allow
Action:
- "lex:DeleteBot"
Expand All @@ -83,12 +82,23 @@ Resources:
- "lex:DeleteIntentVersion"
- "lex:GetBuiltinIntents"
Resource:
- "*"
- !Sub "arn:${AWS::Partition}:lex:${AWS::Region}:${AWS::AccountId}:bot:*"
- !Sub "arn:${AWS::Partition}:lex:${AWS::Region}:${AWS::AccountId}:intent:*:*"
- !Sub "arn:${AWS::Partition}:lex:${AWS::Region}:${AWS::AccountId}:slottype:*:*"
- Effect: Allow
Action:
- "kendra:Query"
Resource:
- "*"
- Fn::Join:
- ""
- - "arn:"
- !Ref 'AWS::Partition'
- ":kendra:"
- !Ref 'AWS::Region'
- ":"
- !Ref 'AWS::AccountId'
- ":index/"
- Fn::ImportValue: KendraIndexID
- Effect: Allow
Action:
- "iam:GetRole"
Expand All @@ -101,7 +111,7 @@ Resources:
- "lambda:AddPermission"
- "lambda:RemovePermission"
Resource:
- "*"
- !Sub "arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:*"

LambdaFunction:
Type: AWS::Lambda::Function
Expand Down
17 changes: 8 additions & 9 deletions templates/lex_bot_kendra_master.template.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AWSTemplateFormatVersion: 2010-09-09
Description: A master template which creates a Lex Bot and integrate it with a Kendra Index with S3 bucket as a document respository. (qs-1qu380l7l)
Description: A primary template which creates a Lex Bot and integrate it with a Kendra Index with S3 bucket as a document respository. (qs-1qu380l7l)
Metadata:
QuickStartDocumentation:
EntrypointName: "Parameters for launching stack creation"
Expand Down Expand Up @@ -167,7 +167,7 @@ Resources:
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource:
- arn:aws:logs:*:*:*
- !Sub "arn:${AWS::Partition}:logs:*:*:*"
- Effect: Allow
Action:
- "s3:GetObject"
Expand All @@ -176,23 +176,22 @@ Resources:
- "s3:PutObjectTagging"
- "s3:DeleteObject"
Resource:
- "arn:aws:s3:*:*:accesspoint/*"
- !Join
- ''
- - 'arn:aws:s3:::'
- - !Sub 'arn:${AWS::Partition}:s3:::'
- !Ref RegionalArtifactBucket
- !Join
- ''
- - 'arn:aws:s3:::'
- - !Sub 'arn:${AWS::Partition}:s3:::'
- !Ref RegionalArtifactBucket
- '/*'
- !Join
- ''
- - 'arn:aws:s3:::'
- - !Sub 'arn:${AWS::Partition}:s3:::'
- !Ref QSS3BucketName
- !Join
- ''
- - 'arn:aws:s3:::'
- - !Sub 'arn:${AWS::Partition}:s3:::'
- !Ref QSS3BucketName
- '/*'
- Effect: Allow
Expand All @@ -205,7 +204,8 @@ Resources:
Action:
- lambda:InvokeFunction
Resource:
- "*"
- !Sub "arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:*"

RegionalArtifactBucket:
Type: AWS::S3::Bucket

Expand Down Expand Up @@ -325,7 +325,6 @@ Resources:
QSS3KeyPrefix: !Ref QSS3KeyPrefix
ArtifactsS3BucketName: !Ref 'RegionalArtifactBucket'
KendraS3BucketName: !Ref KendraS3BucketName

LexBotStack:
Type: 'AWS::CloudFormation::Stack'
Properties:
Expand Down
37 changes: 20 additions & 17 deletions templates/lex_bot_resource.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,8 @@ Resources:
StringEquals:
sts:ExternalId: !Ref ExternalID
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/AmazonLexReadOnly"
- "arn:aws:iam::aws:policy/AmazonLexRunBotsOnly"

LexSLRole:
Type: AWS::IAM::ServiceLinkedRole
Properties:
AWSServiceName: lex.amazonaws.com
Description: Amazon Lex Service Lined Role
- !Sub "arn:${AWS::Partition}:iam::${AWS::Partition}:policy/AmazonLexReadOnly"
- !Sub "arn:${AWS::Partition}:iam::${AWS::Partition}:policy/AmazonLexRunBotsOnly"

LexBotIAMRole:
Type: AWS::IAM::Role
Expand Down Expand Up @@ -90,16 +84,15 @@ Resources:
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource:
- arn:aws:logs:*:*:*
- !Sub "arn:${AWS::Partition}:logs:*:*:*"
- Effect: Allow
Action:
- "s3:GetObject"
- "s3:ListBucket"
- "s3:HeadBucket"
Resource:
- !Sub "arn:aws:s3:::${ArtifactsS3BucketName}"
- "arn:aws:s3:*:*:accesspoint/*"
- !Sub "arn:aws:s3:::${ArtifactsS3BucketName}/*"
- !Sub "arn:${AWS::Partition}:s3:::${ArtifactsS3BucketName}"
- !Sub "arn:${AWS::Partition}:s3:::${ArtifactsS3BucketName}/*"
- Effect: Allow
Action:
- "lex:DeleteBot"
Expand Down Expand Up @@ -131,7 +124,9 @@ Resources:
- "lex:CreateIntentVersion"
- "lex:PutBotAlias"
Resource:
- "*"
- !Sub "arn:${AWS::Partition}:lex:${AWS::Region}:${AWS::AccountId}:bot:*"
- !Sub "arn:${AWS::Partition}:lex:${AWS::Region}:${AWS::AccountId}:intent:*:*"
- !Sub "arn:${AWS::Partition}:lex:${AWS::Region}:${AWS::AccountId}:slottype:*:*"
- Effect: Allow
Action:
- "iam:GetRole"
Expand All @@ -143,20 +138,29 @@ Resources:
- "lambda:AddPermission"
- "lambda:RemovePermission"
Resource:
- "*"
- !Sub "arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:*"
- Effect: Allow
Action:
- "events:PutRule"
- "events:DeleteRule"
- "events:PutTargets"
- "events:RemoveTargets"
Resource:
- "*"
- !Sub "arn:${AWS::Partition}:events:${AWS::Region}:${AWS::AccountId}:rule/*"
- Effect: Allow
Action:
- "kendra:Query"
Resource:
- "*"
- Fn::Join:
- ""
- - "arn:"
- !Ref 'AWS::Partition'
- ":kendra:"
- !Ref 'AWS::Region'
- ":"
- !Ref 'AWS::AccountId'
- ":index/"
- Fn::ImportValue: KendraIndexID

CrHelperLayer:
Type: AWS::Lambda::LayerVersion
Expand Down Expand Up @@ -211,4 +215,3 @@ Outputs:
LexBotName:
Description: Lex Bot Name
Value: !GetAtt LexBotOpsFunctionTrigger.BotName

0 comments on commit 7e12941

Please sign in to comment.