Skip to content

sample-apps/ec2-spot - does ec2Client need to be static? #360

@DmitryLukyanov

Description

@DmitryLukyanov

I'm looking at this sample app and have a question why this sample uses a static modifier for ec2Client? As far as I understand, the intention is to use this client as singleton, but the same behavior will be reached if ec2Client will be non static, won't it? Like:

    private AmazonEC2Client ec2Client;

    public Function() {
      AWSSDKHandler.RegisterXRayForAllServices();
      ec2Client = new AmazonEC2Client();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions