File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,32 @@ async fn function_handler(event: LambdaEvent<LogsEvent>) -> Result<(), Error> {
2727
2828 println ! ( "{:?}" , v) ;
2929
30+ let arn = v[ "requestParameters" ] [ "tagSpecificationSet" ] [ "items" ]
31+ . as_array ( )
32+ . unwrap ( )
33+ . iter ( )
34+ . filter ( |x| x[ "resourceType" ] == "image" )
35+ . map ( |x| & x[ "tags" ] )
36+ . next ( )
37+ . unwrap ( )
38+ . as_array ( )
39+ . unwrap ( )
40+ . iter ( )
41+ . filter ( |x| x[ "key" ] == "Ec2ImageBuilderArn" )
42+ . map ( |x| & x[ "value" ] )
43+ . next ( )
44+ . unwrap ( )
45+ . as_str ( )
46+ . unwrap ( ) ;
47+
3048 let rsp = client
3149 . publish ( )
3250 . topic_arn ( std:: env:: var ( "TOPIC_ARN" ) . unwrap ( ) )
33- . message ( v[ "responseElements" ] [ "imageId" ] . as_str ( ) . unwrap ( ) )
51+ . message ( format ! (
52+ "{} {}" ,
53+ arn,
54+ v[ "responseElements" ] [ "imageId" ] . as_str( ) . unwrap( )
55+ ) )
3456 . send ( )
3557 . await ?;
3658
You can’t perform that action at this time.
0 commit comments