@@ -27,7 +27,7 @@ func convertGetAuthorizerOutputToAuthorizer(output *apigateway.GetAuthorizerOutp
2727 }
2828}
2929
30- func authorizerOutputMapper (scope string , awsItem * types.Authorizer ) (* sdp.Item , error ) {
30+ func authorizerOutputMapper (query , scope string , awsItem * types.Authorizer ) (* sdp.Item , error ) {
3131 attributes , err := adapterhelpers .ToAttributesWithExclude (awsItem , "tags" )
3232 if err != nil {
3333 return nil , err
@@ -40,6 +40,20 @@ func authorizerOutputMapper(scope string, awsItem *types.Authorizer) (*sdp.Item,
4040 Scope : scope ,
4141 }
4242
43+ item .LinkedItemQueries = append (item .LinkedItemQueries , & sdp.LinkedItemQuery {
44+ Query : & sdp.Query {
45+ Type : "apigateway-rest-api" ,
46+ Method : sdp .QueryMethod_GET ,
47+ Query : strings .Split (query , "/" )[0 ],
48+ Scope : scope ,
49+ },
50+ BlastPropagation : & sdp.BlastPropagation {
51+ // They are tightly coupled, so we need to propagate the blast to the linked item
52+ In : true ,
53+ Out : true ,
54+ },
55+ })
56+
4357 return & item , nil
4458}
4559
@@ -107,8 +121,8 @@ func NewAPIGatewayAuthorizerAdapter(client *apigateway.Client, accountID string,
107121
108122 return items , nil
109123 },
110- ItemMapper : func (_ , scope string , awsItem * types.Authorizer ) (* sdp.Item , error ) {
111- return authorizerOutputMapper (scope , awsItem )
124+ ItemMapper : func (query , scope string , awsItem * types.Authorizer ) (* sdp.Item , error ) {
125+ return authorizerOutputMapper (query , scope , awsItem )
112126 },
113127 }
114128}
0 commit comments