AWS code-library documentation change
Summary
Removed the 'Get started' section containing code examples for listing load balancers using Java, JavaScript, and Python SDKs
Security assessment
The change removes introductory code examples demonstrating how to list load balancers. There is no evidence of security vulnerabilities being addressed, no security-related content modifications, and no references to security incidents or vulnerabilities in the removed content.
Diff
diff --git a/code-library/latest/ug/elastic-load-balancing-v2_code_examples.md b/code-library/latest/ug/elastic-load-balancing-v2_code_examples.md index 897235d7b..40aebaae7 100644 --- a//code-library/latest/ug/elastic-load-balancing-v2_code_examples.md +++ b//code-library/latest/ug/elastic-load-balancing-v2_code_examples.md @@ -28,124 +27,0 @@ _Scenarios_ are code examples that show you how to accomplish specific tasks by -**Get started** - -The following code examples show how to get started using ELB. - -Java - - -**SDK for Java 2.x** - - -###### Note - -There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/resilient_service#code-examples). - - - public class HelloLoadBalancer { - - public static void main(String[] args) { - ElasticLoadBalancingV2Client loadBalancingV2Client = ElasticLoadBalancingV2Client.builder() - .region(Region.US_EAST_1) - .build(); - - DescribeLoadBalancersResponse loadBalancersResponse = loadBalancingV2Client - .describeLoadBalancers(r -> r.pageSize(10)); - List<LoadBalancer> loadBalancerList = loadBalancersResponse.loadBalancers(); - for (LoadBalancer lb : loadBalancerList) - System.out.println("Load Balancer DNS name = " + lb.dnsName()); - } - } - - - - * For API details, see [DescribeLoadBalancers](https://docs.aws.amazon.com/goto/SdkForJavaV2/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancers) in _AWS SDK for Java 2.x API Reference_. - - - - -JavaScript - - -**SDK for JavaScript (v3)** - - -###### Note - -There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/elastic-load-balancing-v2#code-examples). - - - import { - ElasticLoadBalancingV2Client, - DescribeLoadBalancersCommand, - } from "@aws-sdk/client-elastic-load-balancing-v2"; - - export async function main() { - const client = new ElasticLoadBalancingV2Client({}); - const { LoadBalancers } = await client.send( - new DescribeLoadBalancersCommand({}), - ); - const loadBalancersList = LoadBalancers.map( - (lb) => `• ${lb.LoadBalancerName}: ${lb.DNSName}`, - ).join("\n"); - console.log( - "Hello, Elastic Load Balancing! Let's list some of your load balancers:\n", - loadBalancersList, - ); - } - - // Call function if run directly - import { fileURLToPath } from "node:url"; - if (process.argv[1] === fileURLToPath(import.meta.url)) { - main(); - } - - - - * For API details, see [DescribeLoadBalancers](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/elastic-load-balancing-v2/command/DescribeLoadBalancersCommand) in _AWS SDK for JavaScript API Reference_. - - - - -Python - - -**SDK for Python (Boto3)** - - -###### Note - -There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/elastic-load-balancing#code-examples). - - - import boto3 - - - def hello_elbv2(elbv2_client): - """ - Use the AWS SDK for Python (Boto3) to create an Elastic Load Balancing V2 client and list - up to ten of the load balancers for your account. - This example uses the default settings specified in your shared credentials - and config files. - - :param elbv2_client: A Boto3 Elastic Load Balancing V2 client object. - """ - print("Hello, Elastic Load Balancing! Let's list some of your load balancers:") - load_balancers = elbv2_client.describe_load_balancers(PageSize=10).get( - "LoadBalancers", [] - ) - if load_balancers: - for lb in load_balancers: - print(f"\t{lb['LoadBalancerName']}: {lb['DNSName']}") - else: - print("Your account doesn't have any load balancers.") - - - if __name__ == "__main__": - hello_elbv2(boto3.client("elbv2")) - - - - * For API details, see [DescribeLoadBalancers](https://docs.aws.amazon.com/goto/boto3/elasticloadbalancingv2-2015-12-01/DescribeLoadBalancers) in _AWS SDK for Python (Boto3) API Reference_. - - - -