Skip to content

Commit

Permalink
READMES
Browse files Browse the repository at this point in the history
  • Loading branch information
ford-at-aws committed Feb 14, 2024
1 parent 9d1fca7 commit 4cb23bf
Show file tree
Hide file tree
Showing 62 changed files with 65 additions and 58 deletions.
2 changes: 1 addition & 1 deletion ruby/example_code/cloudwatch/alarm_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def alarm_actions_disabled?(cloudwatch_client, alarm_name)
return false
end

# Full example call:
# Example usage:
def run_me
alarm_name = "ObjectsInBucket"
alarm_description = "Objects exist in this bucket for more than 1 day."
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/cloudwatch/alarm_basics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def alarm_deleted?(cloudwatch_client, alarm_name)
return false
end

# Full example call:
# Example usage:
def run_me
alarm_name = "ObjectsInBucket"
alarm_description = "Objects exist in this bucket for more than 1 day."
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/cloudwatch/create_alarm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def alarm_created_or_updated?(
return false
end

# Full example call:
# Example usage:
def run_me
alarm_name = "ObjectsInBucket"
alarm_description = "Objects exist in this bucket for more than 1 day."
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/cloudwatch/metrics_basics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def list_metrics_for_namespace(cloudwatch_client, metric_namespace)
end
end

# Full example call:
# Example usage:
def run_me
metric_namespace = "SITE/TRAFFIC"
# Replace us-west-2 with the AWS Region you're using for Amazon CloudWatch.
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/cloudwatch/show_alarms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def describe_metric_alarms(cloudwatch_client)
puts "Error getting information about alarms: #{e.message}"
end

# Full example call:
# Example usage:
def run_me
region = ""

Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/ec2/ec2-ruby-example-attach-igw-vpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def internet_gateway_created_and_attached?(
return false
end

# Full example call:
# Example usage:
def run_me
vpc_id = ""
tag_key = ""
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/ec2/ec2-ruby-example-create-instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def instance_created?(
return false
end

# Full example call:
# Example usage:
def run_me
image_id = ""
key_pair_name = ""
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/ec2/ec2-ruby-example-create-key-pair.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def key_pair_created?(ec2_client, key_pair_name)
return false
end

# Full example call:
# Example usage:
def run_me
key_pair_name = ""
region = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def route_table_created_and_associated?(
return false
end

# Full example call:
# Example usage:
def run_me
vpc_id = ""
subnet_id = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def security_group_created_with_egress?(
return false
end

# Full example call:
# Example usage:
def run_me
group_name = ""
description = ""
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/ec2/ec2-ruby-example-create-subnet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def subnet_created_and_tagged?(
return false
end

# Full example call:
# Example usage:
def run_me
vpc_id = ""
cidr_block = ""
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/ec2/ec2-ruby-example-create-vpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def vpc_created_and_tagged?(
return false
end

# Full example call:
# Example usage:
def run_me
cidr_block = ""
tag_key = ""
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/ec2/ec2-ruby-example-elastic-ips.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def elastic_ip_address_released?(ec2_client, allocation_id)
end
# snippet-end:[ec2.Ruby.releaseElasticIPs]

# Full example call:
# Example usage:
def run_me
instance_id = ""
region = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def list_instance_ids_states(ec2_resource)
puts "Error getting information about instances: #{e.message}"
end

#Full example call:
# Example usage:
def run_me
region = ""
# Print usage information and then stop.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def list_instance_ids_states_by_tag(ec2_resource, tag_key, tag_value)
puts "Error getting information about instances: #{e.message}"
end

#Full example call:
# Example usage:
def run_me
tag_key = ""
tag_value = ""
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/ec2/ec2-ruby-example-key-pairs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def key_pair_deleted?(ec2_client, key_pair_name)
return false
end

# Full example call:
# Example usage:
def run_me
key_pair_name = ""
region = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def list_instance_state(ec2_client, instance_id)
puts "Error getting information about instance: #{e.message}"
end

# Full example call:
# Example usage:
def run_me
instance_id = ""
region = ""
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/ec2/ec2-ruby-example-manage-instances.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def list_instances_information(ec2_client)
end
end

# Full example call:
# Example usage:
def run_me
instance_id = ""
region = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def request_instance_reboot(ec2_client, instance_id)
puts "Error requesting reboot: #{e.message}"
end

# Full example call:
# Example usage:
def run_me
instance_id = ""
region = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def list_availability_zones(ec2_client)
end
end

# Full example call:
# Example usage:
def run_me
region = ""
# Print usage information and then stop.
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/ec2/ec2-ruby-example-security-group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def security_group_deleted?(ec2_client, security_group_id)
return false
end

# Full example call:
# Example usage:
def run_me
group_name = ""
description = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def instance_started?(ec2_client, instance_id)
return false
end

# Full example call:
# Example usage:
def run_me
instance_id = ""
region = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def instance_stopped?(ec2_client, instance_id)
return false
end

# Full example call:
# Example usage:
def run_me
instance_id = ""
region = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def instance_terminated?(ec2_client, instance_id)
return false
end

# Full example call:
# Example usage:
def run_me
instance_id = ""
region = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def manual_cleanup_notice(
puts "- The Amazon EC2 instance with the ID '#{instance_id}'."
end

# Full example call:
# Example usage:
def run_me
# Properties for the Amazon SNS topic.
topic_name = "aws-doc-sdk-examples-topic"
Expand Down
3 changes: 2 additions & 1 deletion ruby/example_code/iam/list_groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ def list_groups(count)
raise
end
end
# snippet-end:[ruby.iam.ListGroups]

# Execute the code if the file is the main program
# Example usage:
if $PROGRAM_NAME == __FILE__
iam_client = Aws::IAM::Client.new
iam_group_manager = IamGroupManager.new(iam_client)
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/iam/manage_account_aliases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def delete_account_alias(account_alias)
end
# snippet-end:[iam.ruby.ManageAccountAliases]

# Full example usage
# Example usage:
if $PROGRAM_NAME == __FILE__
iam_client = Aws::IAM::Client.new
manager = IAMAliasManager.new(iam_client)
Expand Down
4 changes: 2 additions & 2 deletions ruby/example_code/iam/manage_roles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "aws-sdk-iam"
require "logger"

# snippet-start:[ruby.iam.CreateRole]
# snippet-start:[ruby.iam.ManageRoles]
# Manages IAM roles
class RoleManager
# Initialize with an AWS IAM client
Expand Down Expand Up @@ -163,8 +163,8 @@ def delete_service_linked_role(role)
end
end
# snippet-end:[ruby.iam.DeleteServiceLinkedRole]

end
# snippet-end:[ruby.iam.ManageRoles]

# Example usage:
if __FILE__ == $PROGRAM_NAME
Expand Down
2 changes: 1 addition & 1 deletion ruby/example_code/iam/scenario_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def delete_role(role_name)
end
end

# Execute only if the script is the main program
# Example usage:
if $PROGRAM_NAME == __FILE__
iam_client = Aws::IAM::Client.new
user_and_role_manager = IAMUserAndRoleManager.new(iam_client)
Expand Down
3 changes: 1 addition & 2 deletions ruby/example_code/s3/auth_federation_token_request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ def list_objects_in_bucket?(s3_client, bucket_name)
puts "Error while accessing the bucket named '#{bucket_name}': #{e.message}"
end

# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.
# Example usage:
def run_me
region = "us-west-2"
user_name = "my-user"
Expand Down
3 changes: 1 addition & 2 deletions ruby/example_code/s3/auth_request_object_keys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def list_bucket_objects?(s3_client, bucket_name)
return false
end

# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.
# Example usage:
def run_me
region = "us-west-2"
bucket_name = "BUCKET_NAME"
Expand Down
3 changes: 1 addition & 2 deletions ruby/example_code/s3/auth_session_token_request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ def list_objects_in_bucket?(s3_client, bucket_name)
end
# snippet-end:[s3.ruby.auth_session_token_request_test.rb]

# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.
# Example usage:
def run_me
user_name = "my-user"
region = "us-west-2"
Expand Down
1 change: 1 addition & 0 deletions ruby/example_code/s3/bucket_cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def delete_cors
end
# snippet-end:[ruby.example_code.s3.helper.end.BucketCorsWrapper]

# Example usage:
def run_demo
bucket_name = "doc-example-bucket"
allowed_methods = %w[GET PUT]
Expand Down
1 change: 1 addition & 0 deletions ruby/example_code/s3/bucket_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def location
end
end

# Example usage:
def run_demo
region = "us-west-2"
wrapper = BucketCreateWrapper.new(Aws::S3::Bucket.new("doc-example-bucket-#{Random.uuid}"))
Expand Down
1 change: 1 addition & 0 deletions ruby/example_code/s3/bucket_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def list_buckets(count)
end
end

# Example usage:
def run_demo
wrapper = BucketListWrapper.new(Aws::S3::Resource.new)
wrapper.list_buckets(25)
Expand Down
1 change: 1 addition & 0 deletions ruby/example_code/s3/bucket_list_objects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def list_objects(max_objects)
end
end

# Example usage:
def run_demo
bucket_name = "doc-example-bucket"

Expand Down
1 change: 1 addition & 0 deletions ruby/example_code/s3/bucket_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def delete_policy
end
# snippet-end:[ruby.example_code.s3.helper.end.BucketPolicyWrapper]

# Example usage:
def run_demo
bucket_name = "doc-example-bucket"
policy_user = "arn:aws:iam::111122223333:user/Martha"
Expand Down
1 change: 1 addition & 0 deletions ruby/example_code/s3/bucket_put_encryption.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def set_encryption(bucket_name)
end
end

# Example usage:
def run_demo
bucket_name = "doc-example-bucket"
wrapper = BucketEncryptionWrapper.new(Aws::S3::Client.new)
Expand Down
1 change: 1 addition & 0 deletions ruby/example_code/s3/bucket_put_website.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def set_website(index_document, error_document)
end
end

# Example usage:
def run_demo
bucket_name = "doc-example-bucket"
index_document = "index.html"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ def get_random_aes_256_gcm_key
return random_key_64
end

# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.
# Example usage:
def run_me
bucket_name = "doc-example-bucket"
object_key = "my-file.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ def encrypted_object_uploaded?(
return false
end

# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.
# Example usage:
def run_me
bucket_name = "doc-example-bucket"
object_key = "my-file.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def get_decrypted_object_content(
return "Error getting object content: #{e.message}"
end

# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.
# Example usage:
def run_me
bucket_name = "doc-example-bucket"
object_key = "my-file.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def get_decrypted_object_content(
return "Error getting object content: #{e.message}"
end

# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.
# Example usage:
def run_me
bucket_name = "doc-example-bucket"
object_key = "my-file.txt"
Expand Down
Loading

0 comments on commit 4cb23bf

Please sign in to comment.