SIGN IN SIGN UP

Welcome to the AWS Code Examples Repository. This repo contains code examples used in the AWS documentation, AWS SDK Developer Guides, and more. For more information, see the Readme.md file below.

0 0 1 Java
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# snippet-start:[codebuild.Ruby.listProjects]
require 'aws-sdk-codebuild' # v2: require 'aws-sdk'
2022-10-12 06:30:39 -06:00
client = Aws::CodeBuild::Client.new
resp = client.list_projects({
sort_by: 'NAME', # accepts NAME, CREATED_TIME, LAST_MODIFIED_TIME
sort_order: 'ASCENDING' # accepts ASCENDING, DESCENDING
})
if resp.projects.empty?
puts 'No projects found!'
else
resp.projects.each { |p| puts p }
end
# snippet-end:[codebuild.Ruby.listProjects]