示例#1
0
 public MyStack()
 {
     var example = new Aws.Ebs.Volume("example", new Aws.Ebs.VolumeArgs
     {
         AvailabilityZone = "us-west-2a",
         Size             = 40,
         Tags             =
         {
             { "Name", "HelloWorld" },
         },
     });
     var exampleSnapshot = new Aws.Ebs.Snapshot("exampleSnapshot", new Aws.Ebs.SnapshotArgs
     {
         Tags =
         {
             { "Name", "HelloWorld_snap" },
         },
         VolumeId = example.Id,
     });
     var exampleCopy = new Aws.Ebs.SnapshotCopy("exampleCopy", new Aws.Ebs.SnapshotCopyArgs
     {
         SourceRegion     = "us-west-2",
         SourceSnapshotId = exampleSnapshot.Id,
         Tags             =
         {
             { "Name", "HelloWorld_copy_snap" },
         },
     });
 }
示例#2
0
 public MyStack()
 {
     var current = Output.Create(Aws.Ebs.GetDefaultKmsKey.InvokeAsync());
     var example = new Aws.Ebs.Volume("example", new Aws.Ebs.VolumeArgs
     {
         AvailabilityZone = "us-west-2a",
         Encrypted        = true,
         KmsKeyId         = current.Apply(current => current.KeyArn),
     });
 }
示例#3
0
 public MyStack()
 {
     var example = new Aws.Ebs.Volume("example", new Aws.Ebs.VolumeArgs
     {
         AvailabilityZone = "us-west-2a",
         Size             = 40,
         Tags             =
         {
             { "Name", "HelloWorld" },
         },
     });
 }
示例#4
0
 public MyStack()
 {
     var example = new Aws.Ebs.Volume("example", new Aws.Ebs.VolumeArgs
     {
         AvailabilityZone = "us-west-2a",
         Size             = 40,
     });
     var exampleSnapshot = new Aws.Ebs.Snapshot("exampleSnapshot", new Aws.Ebs.SnapshotArgs
     {
         VolumeId = example.Id,
     });
     var examplePerm = new Aws.Ec2.SnapshotCreateVolumePermission("examplePerm", new Aws.Ec2.SnapshotCreateVolumePermissionArgs
     {
         AccountId  = "12345678",
         SnapshotId = exampleSnapshot.Id,
     });
 }
示例#5
0
 public MyStack()
 {
     var example = new Aws.Ebs.Volume("example", new Aws.Ebs.VolumeArgs
     {
         AvailabilityZone = "us-west-2a",
         Size             = 40,
         Tags             =
         {
             { "Name", "HelloWorld" },
         },
     });
     var exampleSnapshot = new Aws.Ebs.Snapshot("exampleSnapshot", new Aws.Ebs.SnapshotArgs
     {
         Tags =
         {
             { "Name", "HelloWorld_snap" },
         },
         VolumeId = example.Id,
     });
 }
示例#6
0
 public MyStack()
 {
     var web = new Aws.Ec2.Instance("web", new Aws.Ec2.InstanceArgs
     {
         Ami = "ami-21f78e11",
         AvailabilityZone = "us-west-2a",
         InstanceType     = "t1.micro",
         Tags             =
         {
             { "Name", "HelloWorld" },
         },
     });
     var example = new Aws.Ebs.Volume("example", new Aws.Ebs.VolumeArgs
     {
         AvailabilityZone = "us-west-2a",
         Size             = 1,
     });
     var ebsAtt = new Aws.Ec2.VolumeAttachment("ebsAtt", new Aws.Ec2.VolumeAttachmentArgs
     {
         DeviceName = "/dev/sdh",
         InstanceId = web.Id,
         VolumeId   = example.Id,
     });
 }