Created
October 1, 2022 15:50
-
-
Save kuredev/e0b8c7d9bdac9c2534ddfaccd5cbc278 to your computer and use it in GitHub Desktop.
GoでLambdaのリソースポリシーを取得するスニペット
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/lambda" | |
) | |
func main() { | |
fmt.Println("sss"); | |
sess := session.Must(session.NewSessionWithOptions(session.Options{ | |
Config: aws.Config{ | |
Region: aws.String("ap-northeast-1"), | |
}, | |
})) | |
lambdaClient := lambda.New(sess) | |
policyOutput, _ := lambdaClient.GetPolicy(&lambda.GetPolicyInput{ | |
FunctionName: aws.String("arn:aws:lambda:ap-northeast-1:xxxxxxxxxxxxx:function:xxxxxxxxxx"), | |
}); | |
fmt.Println(policyOutput); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment