Beispiel #1
0
        public static void Configure(IProfileRegistry registry, StartupParameters parameters)
        {
            var region = AwsStartup.ParseRegion(parameters.AwsRegion);
            var creds  = AwsStartup.CredentialsWithFallback(
                parameters.AwsAccessKey, parameters.AwsSecretKey, parameters.AwsProfile);

            registry.For <IAmazonDynamoDB>()
            .Use(ctx => new AmazonDynamoDBClient(creds, new AmazonDynamoDBConfig {
                RegionEndpoint = region
            }));
            registry.For <IAmazonCloudWatch>()
            .Use(ctx => new AmazonCloudWatchClient(creds, new AmazonCloudWatchConfig {
                RegionEndpoint = region
            }));
            registry.For <IAmazonSimpleNotificationService>()
            .Use(ctx => new AmazonSimpleNotificationServiceClient(creds, new AmazonSimpleNotificationServiceConfig {
                RegionEndpoint = region
            }));
            registry.For <IAmazonRDS>()
            .Use(ctx => new AmazonRDSClient(creds, new AmazonRDSConfig {
                RegionEndpoint = region
            }));
            registry.For <IAmazonAutoScaling>()
            .Use(ctx => new AmazonAutoScalingClient(creds, region));
            registry.For <IAmazonCloudFormation>()
            .Use(ctx => new AmazonCloudFormationClient(creds, region));
            registry.For <IAmazonLambda>().Use(ctx => new AmazonLambdaClient(creds, region));
            registry.For <IAmazonEC2>().Use(ctx => new AmazonEC2Client(creds, region));
            registry.For <IAmazonElasticLoadBalancing>().Use(ctx => new AmazonElasticLoadBalancingClient(creds, region));
            registry.For <IAmazonS3>().Use(ctx => new AmazonS3Client(creds, region));
            registry.For <IAmazonStepFunctions>().Use(ctx => new AmazonStepFunctionsClient(creds, region));
        }
Beispiel #2
0
        private void SetupAwsDependencies(StartupParameters parameters)
        {
            var region = AwsStartup.ParseRegion(parameters.AwsRegion);
            var creds  = AwsStartup.CredentialsWithFallback(
                parameters.AwsAccessKey, parameters.AwsSecretKey, parameters.AwsProfile);

            For <IAmazonDynamoDB>()
            .Use(ctx => new AmazonDynamoDBClient(creds,
                                                 CreateClientConfig <AmazonDynamoDBConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonCloudWatch>()
            .Use(ctx => new AmazonCloudWatchClient(creds,
                                                   CreateClientConfig <AmazonCloudWatchConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonSimpleNotificationService>()
            .Use(ctx => new AmazonSimpleNotificationServiceClient(creds,
                                                                  CreateClientConfig <AmazonSimpleNotificationServiceConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonRDS>()
            .Use(ctx => new AmazonRDSClient(creds,
                                            CreateClientConfig <AmazonRDSConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonAutoScaling>()
            .Use(ctx => new AmazonAutoScalingClient(creds,
                                                    CreateClientConfig <AmazonAutoScalingConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonCloudFormation>()
            .Use(ctx => new AmazonCloudFormationClient(creds,
                                                       CreateClientConfig <AmazonCloudFormationConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonLambda>()
            .Use(ctx => new AmazonLambdaClient(creds,
                                               CreateClientConfig <AmazonLambdaConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonEC2>()
            .Use(ctx => new AmazonEC2Client(creds,
                                            CreateClientConfig <AmazonEC2Config>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonElasticLoadBalancing>()
            .Use(ctx => new AmazonElasticLoadBalancingClient(creds,
                                                             CreateClientConfig <AmazonElasticLoadBalancingConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonElasticLoadBalancingV2>()
            .Use(ctx => new AmazonElasticLoadBalancingV2Client(creds,
                                                               CreateClientConfig <AmazonElasticLoadBalancingV2Config>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonS3>()
            .Use(ctx => new AmazonS3Client(creds,
                                           CreateClientConfig <AmazonS3Config>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonStepFunctions>()
            .Use(ctx => new AmazonStepFunctionsClient(creds,
                                                      CreateClientConfig <AmazonStepFunctionsConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
            For <IAmazonCloudWatch>()
            .Use(ctx => new AmazonCloudWatchClient(creds,
                                                   CreateClientConfig <AmazonCloudWatchConfig>(region, ctx.GetInstance <HttpClient>())))
            .Singleton();
        }
Beispiel #3
0
        public static void Configure(IProfileRegistry registry, StartupParameters parameters)
        {
            var region = AwsStartup.ParseRegion(parameters.AwsRegion);
            var creds  = AwsStartup.CredentialsWithFallback(
                parameters.AwsAccessKey, parameters.AwsSecretKey, parameters.AwsProfile);

            registry.For <IAmazonDynamoDB>()
            .Use(ctx => new AmazonDynamoDBClient(creds, new AmazonDynamoDBConfig {
                RegionEndpoint = region
            }));
            registry.For <IAmazonCloudWatch>()
            .Use(ctx => new AmazonCloudWatchClient(creds, new AmazonCloudWatchConfig {
                RegionEndpoint = region
            }));
        }