Skip to content

Commit 8bf3a99

Browse files
authored
Fixes a typo in the specification and basics file. (#7020)
1 parent e0244ec commit 8bf3a99

File tree

4 files changed

+61
-38
lines changed

4 files changed

+61
-38
lines changed

basics_scenarios/s3express_scenario/SPECIFICATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The following shows the output of the Amazon S3 Batch program in the console.
6161
--------------------------------------
6262
Welcome to the Amazon S3 Express Basics demo using PHP!
6363
--------------------------------------
64-
Let's get started! First, please not that S3 Express One Zone works best when working within the AWS infrastructure,
64+
Let's get started! First, please note that S3 Express One Zone works best when working within the AWS infrastructure,
6565
specifically when working in the same Availability Zone. To see the best results in this example, and when you implement
6666
Directory buckets into your infrastructure, it is best to put your Compute resources in the same AZ as your Directory
6767
bucket.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
namespace S3;
6+
7+
use Aws\Exception\AwsException;
8+
use AwsUtilities\RunnableExample;
9+
10+
require_once __DIR__ . "/vendor/autoload.php";
11+
12+
require "S3ExpressBasics.php";
13+
14+
try {
15+
/**
16+
* @var RunnableExample $runner
17+
*/
18+
$runner = new S3ExpressBasics();
19+
$runner->helloService();
20+
$runner->runExample();
21+
} catch (AwsException $error) {
22+
echo "Errored with the following: (" . $error->getCode() . ") - " . $error->getMessage();
23+
} finally {
24+
echo "Cleaning up.\n";
25+
$runner->cleanUp();
26+
}

php/example_code/s3/S3ExpressBasics.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* or as a PHPUnit test:
2020
* vendor/bin/phpunit S3ExpressBasicsTests.php
21-
* /**/
21+
**/
2222

2323
namespace S3;
2424
use Aws\CloudFormation\CloudFormationClient;
@@ -67,7 +67,7 @@ public function runExample()
6767
$uuid = uniqid();
6868

6969
echo <<<INTRO
70-
Let's get started! First, please not that S3 Express One Zone works best when working within the AWS infrastructure,
70+
Let's get started! First, please note that S3 Express One Zone works best when working within the AWS infrastructure,
7171
specifically when working in the same Availability Zone. To see the best results in this example, and when you implement
7272
Directory buckets into your infrastructure, it is best to put your Compute resources in the same AZ as your Directory
7373
bucket.\n
@@ -123,7 +123,7 @@ public function runExample()
123123
echo "Error waiting for the CloudFormation stack to create: {$caught->getAwsErrorMessage()}\n";
124124
throw $caught;
125125
}
126-
$this->resources['StackName'] = $stackName;
126+
$this->resources['stackName'] = $stackName;
127127
$stackInfo = $this->cloudFormationClient->describeStacks([
128128
'StackName' => $result['StackId'],
129129
]);
@@ -138,10 +138,14 @@ public function runExample()
138138
$expressUserName = $output['OutputValue'];
139139
}
140140
}
141+
$this->resources['regularUserName'] = $regularUserName;
142+
$this->resources['expressUserName'] = $expressUserName;
141143
$regularKey = $this->iamService->createAccessKey($regularUserName);
142144
$regularCredentials = new Credentials($regularKey['AccessKeyId'], $regularKey['SecretAccessKey']);
145+
$this->resources['regularKey'] = $regularKey['AccessKeyId'];
143146
$expressKey = $this->iamService->createAccessKey($expressUserName);
144147
$expressCredentials = new Credentials($expressKey['AccessKeyId'], $expressKey['SecretAccessKey']);
148+
$this->resources['expressKey'] = $expressKey['AccessKeyId'];
145149

146150
// 3. Create an additional client using the credentials with S3 Express permissions.
147151
echo "\n";
@@ -317,20 +321,13 @@ public function cleanUp()
317321
}
318322

319323
//delete the stack
320-
if(isset($this->resources['StackName'])){
324+
if(isset($this->resources['stackName'])){
321325
$this->cloudFormationClient->deleteStack([
322-
'StackName' => $this->resources['StackName'],
326+
'StackName' => $this->resources['stackName'],
323327
]);
324-
unset($this->resources['StackName']);
328+
unset($this->resources['stackName']);
325329
}
326330

327-
// $this->iamService->deleteRole($this->resources['roleName']);
328-
// unset($this->resources['roleName']);
329-
330-
// delete User
331-
// $this->iamService->deleteUser($this->resources['userName']);
332-
// unset($this->resources['userName']);
333-
334331
// delete all the objects in both buckets
335332
if(isset($this->resources['objectKey'])){
336333
$this->s3Service->deleteObject($this->resources['directoryBucketName'], $this->resources['objectKey']);

php/example_code/s3/composer.lock

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)