Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP: S3 Express Basics scenario #6975

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

beqqrry-aws
Copy link
Contributor

This pull request submits the Scout for S3 Express Basics scenario using AWS SDK for PHP v3.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@beqqrry-aws beqqrry-aws self-assigned this Oct 14, 2024
@github-actions github-actions bot added the PHP This issue relates to the AWS SDK for PHP label Oct 14, 2024
@beqqrry-aws beqqrry-aws added the Scout An example which other languages will use for reference later on. label Oct 14, 2024
@beqqrry-aws beqqrry-aws requested review from a team, rlhagerm and ford-at-aws and removed request for a team and rlhagerm October 15, 2024 17:01
@beqqrry-aws beqqrry-aws marked this pull request as ready for review October 15, 2024 17:03
@beqqrry-aws beqqrry-aws added the Basics A basic code example showing the core actions for a particular service. label Oct 15, 2024
Copy link
Contributor

@ford-at-aws ford-at-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions about the EC2 file; the S3 content looks great.

Comment on lines +32 to +36
/* Inline declaration example
// snippet-start:[php.example_code.ec2.basics.createClient]
$ec2Client = new Ec2Client(['region' => 'us-west-2', 'version' => 'latest', 'profile' => 'default']);
// snippet-end:[php.example_code.ec2.basics.createClient]
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Comment on lines +62 to +68
public function createVpc($cidr)
{
$result = $this->ec2Client->createVpc([
"CidrBlock" => $cidr,
]);
return $result['Vpc'];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we handle exceptions here?

Comment on lines +74 to +79
public function deleteVpc(mixed $vpcId)
{
$result = $this->ec2Client->deleteVpc([
"VpcId" => $vpcId,
]);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we handle exceptions here?

Comment on lines +85 to +90
public function deleteVpcEndpoint(mixed $vpcEndpointId)
{
$result = $this->ec2Client->deleteVpcEndpoints([
"VpcEndpointIds" => [$vpcEndpointId],
]);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we handle exceptions here?

Comment on lines +47 to +56
public function createVpcEndpoint(string $serviceName, string $vpcId, array $routeTableIds): array
{
$result = $this->ec2Client->createVpcEndpoint([
'ServiceName' => $serviceName,
'VpcId' => $vpcId,
'RouteTableIds' => $routeTableIds,
]);

return $result["VpcEndpoint"];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we handle exceptions here?

@@ -0,0 +1,137 @@
<?php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there tests for this file?

Comment on lines +11 to +17
<!-- <testsuites>-->
<!-- <testsuite name="kms-basics">-->
<!-- <file>kms/tests/KmsBasicsTests.php</file>-->
<!-- </testsuite>-->
<!-- <testsuite name="s3-express-basics">-->
<!-- <file>s3/tests/S3ExpressBasicsTest.php</file>-->
<!-- </testsuite>-->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Basics A basic code example showing the core actions for a particular service. PHP This issue relates to the AWS SDK for PHP Scout An example which other languages will use for reference later on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants