CloudDeploy

 view release on metacpan or  search on metacpan

lib/CCfn.pm  view on Meta::CPAN

package CCfnX::Meta::Attribute::Trait::Attached {
  use Moose::Role;
  Moose::Util::meta_attribute_alias('Attached');
}

package CCfnX::Meta::Attribute::Trait::Attachable {
  use Moose::Role;
  use CCfnX::Deployment;
  Moose::Util::meta_attribute_alias('Attachable');
  has type => (is => 'ro', isa => 'Str', required => 1);
  has generates_params => (is => 'ro', isa => 'ArrayRef[Str]', required => 1);

  sub get_info {
    my ($self, $name, $key) = @_;
    die "Please specify a name for Attachment " . $self->name if (not defined $name);
    my $dep = CCfnX::Deployment->new_with_roles({ name => $name }, 'CCfnX::CloudFormationDeployer', 'CCfnX::PersistentDeployment');
    $dep->get_from_mongo;

    my $output;
    eval { $output = $dep->output($key) };
    

lib/CCfnX/CreateAMIUserData.pm  view on Meta::CPAN

  use Moose;
  extends 'CCfnX::UserData';
  use autodie;

  has '+text' => (lazy => 1,
                  default => sub { 
                                my $self = shift;
                                die "No files defined for generating UserData" unless defined $self->files;
                                return [ map { $self->file_to_lines($_) } @{ $self->files } ]
                             });
  has files => (is => 'ro', required => 1, isa => 'ArrayRef[Str]');
  has signal => (is => 'ro', isa => 'Bool', default => 1);
  has os_family => (is => 'ro', isa => 'Str', default => 'linux');

  sub file_to_lines {
    my ($self, $file) = @_;

    open my $fh, '<', $file;
    my @lines = ();
    while (my $line = <$fh>) {
      push @lines, $self->parse_line($line);

lib/CCfnX/MakeAMIArgs.pm  view on Meta::CPAN

package CCfnX::MakeAMIArgs {
  use Moose;
  extends 'CCfnX::InstanceArgs';
  has template => (is => 'ro', isa => 'ArrayRef[Str]', required => 1);
  has ami => (is => 'ro', isa => 'Str', required => 1, documentation => 'AMI to base the image upon. Takes it as the base AMI, and applies templates to it');
  has os_family => (is => 'ro', isa => 'Str', default => 'linux');
  has devel => (is => 'ro', isa => 'Bool', default => 0, documentation => 'Leaves the instance turned on after executing all templates for debugging pourposes');
  has onlysnapshot => (is => 'ro', isa => 'Bool', default => 0, documentation => 'If the stack has been created with --devel, you can continue the process of converting the instance to AMI with this option');
  has amitag => (is => 'ro', isa => 'Str', documentation => 'Optional: when registering this AMI, we\'ll use this tag to identify it. It should be unique for the region of deployment and the name of the AMI');
}

1;

lib/CCfnX/UserData.pm  view on Meta::CPAN

package CCfnX::UserData {
  use Moose;
  use Cfn;

  extends 'Cfn::Value';

  has Value => (isa => 'Cfn::Value', coerce => 1, is => 'rw', required => 0);
  has text => (is => 'ro', required => 1, isa => 'Str|ArrayRef');

  sub parse_line {
    my ($self, $line) = @_;
    return $line if (ref($line));
    # Use a capturing group in split so that #-#...#-# is returned
    my @elements = split /(\#\-\#.*?\#\-\#)/, $line;
    @elements = map {
      ($_ =~ m/^#\-\#(.*?)\#\-\#$/) ?
        _process_tiefighter("$1") : $_
    } @elements;



( run in 0.724 second using v1.01-cache-2.11-cpan-5f2e87ce722 )