Beispiel #1
0
 public NatGateway(ElasticIp elasticIp, Subnet subnet) : base(ResourceType.AwsEc2NatGateway)
 {
     AllocationId = new ReferenceProperty(elasticIp);
     SubnetId     = new ReferenceProperty(subnet);
     this.DependsOn.Add(elasticIp.LogicalId);
     this.DependsOn.Add(subnet.LogicalId);
 }
Beispiel #2
0
        public override void AddToLaunchConfiguration(LaunchConfiguration configuration)
        {
            base.AddToLaunchConfiguration(configuration);

            this.InstallRemoteDesktopGateway();
            RecordSet routing = RecordSet.AddByHostedZoneName(
                this.Instance.Template,
                $"RecordSet4{this.Instance.LogicalId}",
                new FnJoin(FnJoinDelimiter.None, new ReferenceProperty(ActiveDirectoryBase.DomainTopLevelParameterName), "."),
                new FnJoin(FnJoinDelimiter.Period,
                           this.Instance.LogicalId,
                           new ReferenceProperty(ActiveDirectoryBase.DomainFqdnParameterName)),
                RecordSet.RecordSetTypeEnum.A);

            var eip = new ElasticIp(this.Instance);

            this.Instance.Template.Resources.Add(eip.LogicalId, eip);

            routing.AddResourceRecord(new ReferenceProperty(eip));

            routing.TTL = "60";

            AddSecurityGroup();
        }
Beispiel #3
0
 public ElasticIp AddElasticIp()
 {
     ElasticIp = new ElasticIp(this);
     this.Template.Resources.Add(ElasticIp.LogicalId, ElasticIp);
     return(ElasticIp);
 }