//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // read configuration settings _cloudfrontDistributionId = config.ReadText("WebsiteCloudFront"); // initialize AWS clients _cloudfrontClient = new AmazonCloudFrontClient(); }
/// <summary> /// Constructs an instance with a preconfigured S3 client. This can be used for testing the outside of the Lambda environment. /// </summary> /// <param name="s3Client"></param> public Function(IAmazonS3 s3Client, IAmazonCloudFront cfClient) { this.S3Client = s3Client; if (cfClient != null) { this.cfClient = cfClient; } }
public CloudFrontOperations() { client = new AmazonCloudFrontClient(credentials, Amazon.RegionEndpoint.USWest1); S3Origin origin = new S3Origin { } client.CreateDistribution(new CreateDistributionRequest { DistributionConfig = new DistributionConfig { Origins = new Origins { } } }) }
public S3StaticWebsiteService(IAmazonS3 amazonS3, IAmazonCloudFront cloudFrontService, ILogger <S3StaticWebsiteService> logger, AWSConfig awsConfig, EnvironmentConfig environmentConfig, CloudFrontConfig cloudFrontConfig) { _amazonS3 = amazonS3; _logger = logger; _awsConfig = awsConfig; _cloudFrontService = cloudFrontService; _environmentConfig = environmentConfig; _cloudFrontConfig = cloudFrontConfig; }
public AwsS3Storage( [NotNull] string accessKey, [NotNull] string secretKey, [NotNull] string bucketName, [NotNull] string region, [CanBeNull] string cloudFrontDistributionId = null, bool supportAcl = true) { var regionEndpoint = RegionEndpoint.GetBySystemName(region); myS3Client = new AmazonS3Client(accessKey, secretKey, regionEndpoint); myCloudFrontClient = new AmazonCloudFrontClient(accessKey, secretKey, regionEndpoint); myBucketName = bucketName ?? throw new ArgumentNullException(nameof(bucketName)); myCloudFrontDistributionId = cloudFrontDistributionId; mySupportAcl = supportAcl; }
private Amazon.CloudFront.Model.TestFunctionResponse CallAWSServiceOperation(IAmazonCloudFront client, Amazon.CloudFront.Model.TestFunctionRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudFront", "TestFunction"); try { #if DESKTOP return(client.TestFunction(request)); #elif CORECLR return(client.TestFunctionAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
internal CloudFrontPaginatorFactory(IAmazonCloudFront client) { this.client = client; }
protected override void ProcessRecord() { base.ProcessRecord(); Client = CreateClient(_CurrentCredentials, _RegionEndpoint); }
internal ListDistributionsPaginator(IAmazonCloudFront client, ListDistributionsRequest request) { this._client = client; this._request = request; }
internal ListCloudFrontOriginAccessIdentitiesPaginator(IAmazonCloudFront client, ListCloudFrontOriginAccessIdentitiesRequest request) { this._client = client; this._request = request; }
public CloudFrontInvalidator(IAmazonCloudFront cloudFrontClient) { this.cloudFrontClient = cloudFrontClient; }
public CloudFrontHelper(IAmazonCloudFront cloudFrontClient) { _cloudFrontClient = cloudFrontClient; }
public InvalidateCloudFrontFunction(IAmazonCloudFront cloudFrontClient) { CloudFrontClient = cloudFrontClient; }
public CloudFrontSource(IAmazonCloudFront amazonCloudFront) { _amazonCloudFront = amazonCloudFront; }
public UrlSigner(IAmazonCloudFront cfClient, string privateKey, string keyPairId) { _cfClient = cfClient; _privateKey = privateKey; _keyPairId = keyPairId; }
public CloudfrontService(IAmazonCloudFront amazonCloudFront, ILogger <CloudfrontService> logger) { _amazonCloudFront = amazonCloudFront; _logger = logger; }