@aws-amplify/graphql-searchable-transformer
Advanced tools
Comparing version 0.6.1-headless-s3-not-for-production.0 to 0.6.1
@@ -6,3 +6,3 @@ # Change Log | ||
## [0.6.1-headless-s3-not-for-production.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-searchable-transformer@0.6.0...@aws-amplify/graphql-searchable-transformer@0.6.1-headless-s3-not-for-production.0) (2021-09-22) | ||
## [0.6.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-searchable-transformer@0.6.0...@aws-amplify/graphql-searchable-transformer@0.6.1) (2021-09-27) | ||
@@ -13,2 +13,3 @@ | ||
* **graphql-model-transformer:** [@model](https://github.com/model) conflict resolution ([#8035](https://github.com/aws-amplify/amplify-cli/issues/8035)) ([f3bdc4a](https://github.com/aws-amplify/amplify-cli/commit/f3bdc4ac1fcf596f634d9d2e968785e76f7b138c)) | ||
* **graphql-model-transformer:** iam role name does not exceed 64 characters ([#8244](https://github.com/aws-amplify/amplify-cli/issues/8244)) ([812a671](https://github.com/aws-amplify/amplify-cli/commit/812a67163d6dd33160bf7ace9afd538c83a7af1a)) | ||
@@ -15,0 +16,0 @@ |
@@ -0,1 +1,2 @@ | ||
import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces'; | ||
import { Domain } from '@aws-cdk/aws-elasticsearch'; | ||
@@ -5,3 +6,3 @@ import { IRole } from '@aws-cdk/aws-iam'; | ||
export declare const createSearchableDomain: (stack: Construct, parameterMap: Map<string, CfnParameter>, apiId: string) => Domain; | ||
export declare const createSearchableDomainRole: (stack: Construct, parameterMap: Map<string, CfnParameter>, apiId: string, envParam: CfnParameter) => IRole; | ||
export declare const createSearchableDomainRole: (context: TransformerContextProvider, stack: Construct, parameterMap: Map<string, CfnParameter>) => IRole; | ||
//# sourceMappingURL=create-searchable-domain.d.ts.map |
@@ -33,9 +33,8 @@ "use strict"; | ||
exports.createSearchableDomain = createSearchableDomain; | ||
const createSearchableDomainRole = (stack, parameterMap, apiId, envParam) => { | ||
const createSearchableDomainRole = (context, stack, parameterMap) => { | ||
const { OpenSearchAccessIAMRoleLogicalID } = graphql_transformer_common_1.ResourceConstants.RESOURCES; | ||
const { OpenSearchAccessIAMRoleName } = graphql_transformer_common_1.ResourceConstants.PARAMETERS; | ||
const { HasEnvironmentParameter } = graphql_transformer_common_1.ResourceConstants.CONDITIONS; | ||
return new aws_iam_1.Role(stack, OpenSearchAccessIAMRoleLogicalID, { | ||
assumedBy: new aws_iam_1.ServicePrincipal('appsync.amazonaws.com'), | ||
roleName: core_1.Fn.conditionIf(HasEnvironmentParameter, core_1.Fn.join('-', [parameterMap.get(OpenSearchAccessIAMRoleName).valueAsString, apiId, envParam.valueAsString]), core_1.Fn.join('-', [parameterMap.get(OpenSearchAccessIAMRoleName).valueAsString, apiId, envParam.valueAsString])).toString(), | ||
roleName: context.resourceHelper.generateIAMRoleName(parameterMap.get(OpenSearchAccessIAMRoleName).valueAsString), | ||
}); | ||
@@ -42,0 +41,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import { GraphQLAPIProvider } from '@aws-amplify/graphql-transformer-interfaces'; | ||
import { GraphQLAPIProvider, TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces'; | ||
import { EventSourceMapping, IFunction } from '@aws-cdk/aws-lambda'; | ||
@@ -6,4 +6,4 @@ import { CfnParameter, Construct, Stack } from '@aws-cdk/core'; | ||
export declare const createLambda: (stack: Stack, apiGraphql: GraphQLAPIProvider, parameterMap: Map<string, CfnParameter>, lambdaRole: IRole, endpoint: string, isProjectUsingDataStore: boolean, region?: string | undefined) => IFunction; | ||
export declare const createLambdaRole: (stack: Construct, parameterMap: Map<string, CfnParameter>) => IRole; | ||
export declare const createLambdaRole: (context: TransformerContextProvider, stack: Construct, parameterMap: Map<string, CfnParameter>) => IRole; | ||
export declare const createEventSourceMapping: (stack: Construct, type: string, target: IFunction, parameterMap: Map<string, CfnParameter>, tableStreamArn?: string | undefined) => EventSourceMapping; | ||
//# sourceMappingURL=create-streaming-lambda.d.ts.map |
@@ -47,4 +47,4 @@ "use strict"; | ||
exports.createLambda = createLambda; | ||
const createLambdaRole = (stack, parameterMap) => { | ||
var _a; | ||
const createLambdaRole = (context, stack, parameterMap) => { | ||
var _a, _b; | ||
const { OpenSearchStreamingLambdaIAMRoleLogicalID } = graphql_transformer_common_1.ResourceConstants.RESOURCES; | ||
@@ -54,3 +54,3 @@ const { OpenSearchStreamingIAMRoleName } = graphql_transformer_common_1.ResourceConstants.PARAMETERS; | ||
assumedBy: new aws_iam_1.ServicePrincipal('lambda.amazonaws.com'), | ||
roleName: (_a = parameterMap.get(OpenSearchStreamingIAMRoleName)) === null || _a === void 0 ? void 0 : _a.valueAsString, | ||
roleName: context.resourceHelper.generateIAMRoleName((_b = (_a = parameterMap.get(OpenSearchStreamingIAMRoleName)) === null || _a === void 0 ? void 0 : _a.valueAsString) !== null && _b !== void 0 ? _b : ''), | ||
}); | ||
@@ -57,0 +57,0 @@ role.attachInlinePolicy(new aws_iam_1.Policy(stack, 'CloudwatchLogsAccess', { |
@@ -44,6 +44,6 @@ "use strict"; | ||
const domain = create_searchable_domain_1.createSearchableDomain(stack, parameterMap, context.api.apiId); | ||
const openSearchRole = create_searchable_domain_1.createSearchableDomainRole(stack, parameterMap, context.api.apiId, envParam); | ||
const openSearchRole = create_searchable_domain_1.createSearchableDomainRole(context, stack, parameterMap); | ||
domain.grantReadWrite(openSearchRole); | ||
const datasource = create_searchable_datasource_1.createSearchableDataSource(stack, context.api, domain.domainEndpoint, openSearchRole, stack.parseArn(domain.domainArn).region); | ||
const lambdaRole = create_streaming_lambda_1.createLambdaRole(stack, parameterMap); | ||
const lambdaRole = create_streaming_lambda_1.createLambdaRole(context, stack, parameterMap); | ||
domain.grantWrite(lambdaRole); | ||
@@ -50,0 +50,0 @@ const lambda = create_streaming_lambda_1.createLambda(stack, context.api, parameterMap, lambdaRole, domain.domainEndpoint, isProjectUsingDataStore, stack.parseArn(domain.domainArn).region); |
{ | ||
"name": "@aws-amplify/graphql-searchable-transformer", | ||
"version": "0.6.1-headless-s3-not-for-production.0", | ||
"version": "0.6.1", | ||
"description": "Amplfy GraphQL @searchable transformer", | ||
@@ -30,17 +30,17 @@ "repository": { | ||
"dependencies": { | ||
"@aws-amplify/graphql-transformer-core": "0.9.1-headless-s3-not-for-production.0", | ||
"@aws-amplify/graphql-transformer-interfaces": "1.9.1-headless-s3-not-for-production.0", | ||
"@aws-cdk/aws-appsync": "~1.119.0", | ||
"@aws-cdk/aws-dynamodb": "~1.119.0", | ||
"@aws-cdk/aws-ec2": "~1.119.0", | ||
"@aws-cdk/aws-elasticsearch": "~1.119.0", | ||
"@aws-cdk/aws-iam": "~1.119.0", | ||
"@aws-cdk/aws-lambda": "~1.119.0", | ||
"@aws-cdk/core": "~1.119.0", | ||
"@aws-amplify/graphql-transformer-core": "0.9.1", | ||
"@aws-amplify/graphql-transformer-interfaces": "1.9.1", | ||
"@aws-cdk/aws-appsync": "~1.124.0", | ||
"@aws-cdk/aws-dynamodb": "~1.124.0", | ||
"@aws-cdk/aws-ec2": "~1.124.0", | ||
"@aws-cdk/aws-elasticsearch": "~1.124.0", | ||
"@aws-cdk/aws-iam": "~1.124.0", | ||
"@aws-cdk/aws-lambda": "~1.124.0", | ||
"@aws-cdk/core": "~1.124.0", | ||
"graphql": "^14.5.8", | ||
"graphql-mapping-template": "4.18.3", | ||
"graphql-transformer-common": "4.19.9" | ||
"graphql-transformer-common": "4.19.10" | ||
}, | ||
"devDependencies": { | ||
"@aws-cdk/assert": "~1.119.0", | ||
"@aws-cdk/assert": "~1.124.0", | ||
"@types/fs-extra": "^8.0.1", | ||
@@ -65,3 +65,3 @@ "@types/node": "^10.17.13" | ||
}, | ||
"gitHead": "633fe35382bff0520a342b58bef3647ab07ee8f2" | ||
"gitHead": "d3896f04442fb541397380a113b68e32ee79789c" | ||
} |
@@ -0,1 +1,2 @@ | ||
import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces'; | ||
import { EbsDeviceVolumeType } from '@aws-cdk/aws-ec2'; | ||
@@ -34,18 +35,12 @@ import { CfnDomain, Domain, ElasticsearchVersion } from '@aws-cdk/aws-elasticsearch'; | ||
export const createSearchableDomainRole = ( | ||
context: TransformerContextProvider, | ||
stack: Construct, | ||
parameterMap: Map<string, CfnParameter>, | ||
apiId: string, | ||
envParam: CfnParameter, | ||
): IRole => { | ||
const { OpenSearchAccessIAMRoleLogicalID } = ResourceConstants.RESOURCES; | ||
const { OpenSearchAccessIAMRoleName } = ResourceConstants.PARAMETERS; | ||
const { HasEnvironmentParameter } = ResourceConstants.CONDITIONS; | ||
return new Role(stack, OpenSearchAccessIAMRoleLogicalID, { | ||
assumedBy: new ServicePrincipal('appsync.amazonaws.com'), | ||
roleName: Fn.conditionIf( | ||
HasEnvironmentParameter, | ||
Fn.join('-', [parameterMap.get(OpenSearchAccessIAMRoleName)!.valueAsString, apiId, envParam.valueAsString]), | ||
Fn.join('-', [parameterMap.get(OpenSearchAccessIAMRoleName)!.valueAsString, apiId, envParam.valueAsString]), | ||
).toString(), | ||
roleName: context.resourceHelper.generateIAMRoleName(parameterMap.get(OpenSearchAccessIAMRoleName)!.valueAsString), | ||
}); | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { GraphQLAPIProvider } from '@aws-amplify/graphql-transformer-interfaces'; | ||
import { GraphQLAPIProvider, TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces'; | ||
import { EventSourceMapping, IFunction, LayerVersion, Runtime, StartingPosition } from '@aws-cdk/aws-lambda'; | ||
@@ -48,3 +48,3 @@ import { CfnParameter, Construct, Fn, Stack, Duration } from '@aws-cdk/core'; | ||
export const createLambdaRole = (stack: Construct, parameterMap: Map<string, CfnParameter>): IRole => { | ||
export const createLambdaRole = (context: TransformerContextProvider, stack: Construct, parameterMap: Map<string, CfnParameter>): IRole => { | ||
const { OpenSearchStreamingLambdaIAMRoleLogicalID } = ResourceConstants.RESOURCES; | ||
@@ -54,3 +54,3 @@ const { OpenSearchStreamingIAMRoleName } = ResourceConstants.PARAMETERS; | ||
assumedBy: new ServicePrincipal('lambda.amazonaws.com'), | ||
roleName: parameterMap.get(OpenSearchStreamingIAMRoleName)?.valueAsString, | ||
roleName: context.resourceHelper.generateIAMRoleName(parameterMap.get(OpenSearchStreamingIAMRoleName)?.valueAsString ?? ''), | ||
}); | ||
@@ -57,0 +57,0 @@ role.attachInlinePolicy( |
@@ -89,3 +89,3 @@ import { TransformerPluginBase, InvalidDirectiveError, MappingTemplate, DirectiveWrapper } from '@aws-amplify/graphql-transformer-core'; | ||
const openSearchRole = createSearchableDomainRole(stack, parameterMap, context.api.apiId, envParam); | ||
const openSearchRole = createSearchableDomainRole(context, stack, parameterMap); | ||
@@ -103,3 +103,3 @@ domain.grantReadWrite(openSearchRole); | ||
// streaming lambda role | ||
const lambdaRole = createLambdaRole(stack, parameterMap); | ||
const lambdaRole = createLambdaRole(context, stack, parameterMap); | ||
domain.grantWrite(lambdaRole); | ||
@@ -106,0 +106,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
375047
4
12
4
79
2500
+ Added@aws-amplify/graphql-transformer-core@0.9.1(transitive)
+ Added@aws-amplify/graphql-transformer-interfaces@1.9.1(transitive)
+ Added@aws-cdk/assets@1.124.0(transitive)
+ Added@aws-cdk/aws-applicationautoscaling@1.124.0(transitive)
+ Added@aws-cdk/aws-appsync@1.124.0(transitive)
+ Added@aws-cdk/aws-autoscaling-common@1.124.0(transitive)
+ Added@aws-cdk/aws-certificatemanager@1.124.0(transitive)
+ Added@aws-cdk/aws-cloudformation@1.124.0(transitive)
+ Added@aws-cdk/aws-cloudwatch@1.124.0(transitive)
+ Added@aws-cdk/aws-codeguruprofiler@1.124.0(transitive)
+ Added@aws-cdk/aws-codestarnotifications@1.124.0(transitive)
+ Added@aws-cdk/aws-cognito@1.124.0(transitive)
+ Added@aws-cdk/aws-dynamodb@1.124.0(transitive)
+ Added@aws-cdk/aws-ec2@1.124.0(transitive)
+ Added@aws-cdk/aws-ecr@1.124.0(transitive)
+ Added@aws-cdk/aws-ecr-assets@1.124.0(transitive)
+ Added@aws-cdk/aws-efs@1.124.0(transitive)
+ Added@aws-cdk/aws-elasticsearch@1.124.0(transitive)
+ Added@aws-cdk/aws-events@1.124.0(transitive)
+ Added@aws-cdk/aws-iam@1.124.0(transitive)
+ Added@aws-cdk/aws-kinesis@1.124.0(transitive)
+ Added@aws-cdk/aws-kms@1.124.0(transitive)
+ Added@aws-cdk/aws-lambda@1.124.0(transitive)
+ Added@aws-cdk/aws-logs@1.124.0(transitive)
+ Added@aws-cdk/aws-rds@1.124.0(transitive)
+ Added@aws-cdk/aws-route53@1.124.0(transitive)
+ Added@aws-cdk/aws-s3@1.124.0(transitive)
+ Added@aws-cdk/aws-s3-assets@1.124.0(transitive)
+ Added@aws-cdk/aws-sam@1.124.0(transitive)
+ Added@aws-cdk/aws-secretsmanager@1.124.0(transitive)
+ Added@aws-cdk/aws-signer@1.124.0(transitive)
+ Added@aws-cdk/aws-sns@1.124.0(transitive)
+ Added@aws-cdk/aws-sqs@1.124.0(transitive)
+ Added@aws-cdk/aws-ssm@1.124.0(transitive)
+ Added@aws-cdk/cloud-assembly-schema@1.124.0(transitive)
+ Added@aws-cdk/core@1.124.0(transitive)
+ Added@aws-cdk/custom-resources@1.124.0(transitive)
+ Added@aws-cdk/cx-api@1.124.0(transitive)
+ Added@aws-cdk/region-info@1.124.0(transitive)
+ Addedgraphql-transformer-common@4.19.10(transitive)
- Removed@aws-amplify/graphql-transformer-core@0.9.1-headless-s3-not-for-production.0(transitive)
- Removed@aws-amplify/graphql-transformer-interfaces@1.9.1-headless-s3-not-for-production.0(transitive)
- Removed@aws-cdk/assets@1.119.0(transitive)
- Removed@aws-cdk/aws-applicationautoscaling@1.119.0(transitive)
- Removed@aws-cdk/aws-appsync@1.119.0(transitive)
- Removed@aws-cdk/aws-autoscaling-common@1.119.0(transitive)
- Removed@aws-cdk/aws-certificatemanager@1.119.0(transitive)
- Removed@aws-cdk/aws-cloudformation@1.119.0(transitive)
- Removed@aws-cdk/aws-cloudwatch@1.119.0(transitive)
- Removed@aws-cdk/aws-codeguruprofiler@1.119.0(transitive)
- Removed@aws-cdk/aws-codestarnotifications@1.119.0(transitive)
- Removed@aws-cdk/aws-cognito@1.119.0(transitive)
- Removed@aws-cdk/aws-dynamodb@1.119.0(transitive)
- Removed@aws-cdk/aws-ec2@1.119.0(transitive)
- Removed@aws-cdk/aws-ecr@1.119.0(transitive)
- Removed@aws-cdk/aws-ecr-assets@1.119.0(transitive)
- Removed@aws-cdk/aws-efs@1.119.0(transitive)
- Removed@aws-cdk/aws-elasticsearch@1.119.0(transitive)
- Removed@aws-cdk/aws-events@1.119.0(transitive)
- Removed@aws-cdk/aws-iam@1.119.0(transitive)
- Removed@aws-cdk/aws-kinesis@1.119.0(transitive)
- Removed@aws-cdk/aws-kms@1.119.0(transitive)
- Removed@aws-cdk/aws-lambda@1.119.0(transitive)
- Removed@aws-cdk/aws-logs@1.119.0(transitive)
- Removed@aws-cdk/aws-rds@1.119.0(transitive)
- Removed@aws-cdk/aws-route53@1.119.0(transitive)
- Removed@aws-cdk/aws-s3@1.119.0(transitive)
- Removed@aws-cdk/aws-s3-assets@1.119.0(transitive)
- Removed@aws-cdk/aws-sam@1.119.0(transitive)
- Removed@aws-cdk/aws-secretsmanager@1.119.0(transitive)
- Removed@aws-cdk/aws-signer@1.119.0(transitive)
- Removed@aws-cdk/aws-sns@1.119.0(transitive)
- Removed@aws-cdk/aws-sqs@1.119.0(transitive)
- Removed@aws-cdk/aws-ssm@1.119.0(transitive)
- Removed@aws-cdk/cloud-assembly-schema@1.119.0(transitive)
- Removed@aws-cdk/core@1.119.0(transitive)
- Removed@aws-cdk/custom-resources@1.119.0(transitive)
- Removed@aws-cdk/cx-api@1.119.0(transitive)
- Removed@aws-cdk/region-info@1.119.0(transitive)
- Removedgraphql-transformer-common@4.19.9(transitive)
Updated@aws-cdk/aws-ec2@~1.124.0
Updated@aws-cdk/aws-iam@~1.124.0
Updated@aws-cdk/aws-lambda@~1.124.0
Updated@aws-cdk/core@~1.124.0