Skip to content
v2.274.0

S3EnvironmentFile Class ​

Environment file from S3.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';

declare const bucket: s3.Bucket;
const s3EnvironmentFile = new ecs.S3EnvironmentFile(bucket, 'key', /* all optional props */ 'objectVersion');
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs
from aws_cdk import aws_s3 as s3

# bucket: s3.Bucket

s3_environment_file = ecs.S3EnvironmentFile(bucket, "key", "objectVersion")
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;
import software.amazon.awscdk.services.s3.*;

Bucket bucket;

S3EnvironmentFile s3EnvironmentFile = new S3EnvironmentFile(bucket, "key", "objectVersion");
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.S3;

Bucket bucket;

var s3EnvironmentFile = new S3EnvironmentFile(bucket, "key", "objectVersion");
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var bucket Bucket

s3EnvironmentFile := awscdk.Aws_ecs.NewS3EnvironmentFile(bucket, jsii.String("key"), jsii.String("objectVersion"))

Initializer ​

ts
new S3EnvironmentFile(bucket: IBucket, key: string, objectVersion?: string)
python
S3EnvironmentFile(bucket: IBucket, key: str, object_version: typing.Optional[str] = None)
java
new S3EnvironmentFile(IBucket bucket, String key, String objectVersion)
csharp
new S3EnvironmentFile(IBucket bucket, string key, string? objectVersion = null)
go
NewS3EnvironmentFile(Bucket IBucket, Key *string, ObjectVersion *string)

Methods ​

bind(_scope: Construct): EnvironmentFileConfigdef bind(self, _scope: Construct) -> EnvironmentFileConfigpublic EnvironmentFileConfig bind(Construct _scope)public EnvironmentFileConfig Bind(Construct _scope)func Bind(_scope Construct) EnvironmentFileConfig#
Called when the container is initialized to allow this object to bind to the stack.
fromAsset(path: string, options?: AssetOptions): AssetEnvironmentFile@staticmethod def from_asset(path: str, options: typing.Optional[AssetOptions] = None) -> AssetEnvironmentFilepublic static AssetEnvironmentFile fromAsset(String path, AssetOptions options)public static AssetEnvironmentFile FromAsset(string path, AssetOptions? options = null)func FromAsset(Path *string, Options AssetOptions) AssetEnvironmentFilestatic#
Loads the environment file from a local disk path.
1 parameter

Parameters

  • pathpathpathpathPath — Local disk path.
fromBucket(bucket: IBucket, key: string, objectVersion?: string): S3EnvironmentFile // chainable@staticmethod def from_bucket(bucket: IBucket, key: str, object_version: typing.Optional[str] = None) -> S3EnvironmentFilepublic static S3EnvironmentFile fromBucket(IBucket bucket, String key, String objectVersion)public static S3EnvironmentFile FromBucket(IBucket bucket, string key, string? objectVersion = null)func FromBucket(Bucket IBucket, Key *string, ObjectVersion *string) S3EnvironmentFilestatic#
Loads the environment file from an S3 bucket.
3 parameters · returns

Parameters

  • bucketbucketbucketbucketBucket — The S3 bucket.
  • keykeykeykeyKey — The object key.
  • objectVersionobject_versionobjectVersionobjectVersionObjectVersion — Optional S3 object version.

Returns: S3EnvironmentFile associated with the specified S3 object.