- AWS Code Sample demonstrates how to obtain information about your account.

/** * Copyright, Inc. or its affiliates. All Rights Reserved. * * This file is licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. A copy of * the License is located at * * * * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * */ package com.example.lambda; import; import; import; import; public class GetAccountSettings { public static void main(String[] args) { Region region = Region.US_EAST_1; LambdaClient awsLambda = LambdaClient.builder() .region(region) .build(); getSettings(awsLambda); } public static void getSettings(LambdaClient awsLambda) { try { GetAccountSettingsResponse response = awsLambda.getAccountSettings(); System.out.println("Total code size for your account is "+response.accountLimit().totalCodeSize() +" bytes"); } catch(LambdaException e) { System.err.println(e.getMessage()); System.exit(1); } } }

Sample Details

Service: Lambda

Last tested: 2020-10-02

Author: AWS-scmacdon

Type: full-example