Skip to content

Commit

Permalink
fix(appsync): fully qualify service principal
Browse files Browse the repository at this point in the history
In aws#22819, a feature flag was added to use standardized service
principal names instead of using a database lookup. This reference
wasn't updated which causes failures in new CDK applications that try
to create AppSync resources. This change passes the fully qualified
service principal when creating a service role for a new data source.

fixes aws#23035
  • Loading branch information
jpignata committed Nov 23, 2022
1 parent 6f4dcfd commit 9315dee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-appsync/lib/data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ export abstract class BaseDataSource extends Construct {
super(scope, id);

if (extended.type !== 'NONE') {
this.serviceRole = props.serviceRole || new Role(this, 'ServiceRole', { assumedBy: new ServicePrincipal('appsync') });
this.serviceRole = props.serviceRole || new Role(this, 'ServiceRole', {
assumedBy: new ServicePrincipal('appsync.amazonaws.com'),
});
}
// Replace unsupported characters from DataSource name. The only allowed pattern is: {[_A-Za-z][_0-9A-Za-z]*}
const name = (props.name ?? id);
Expand Down

0 comments on commit 9315dee

Please sign in to comment.