当前位置: 首页>>代码示例>>Java>>正文


Java Parameter类代码示例

本文整理汇总了Java中com.amazonaws.services.cloudformation.model.Parameter的典型用法代码示例。如果您正苦于以下问题:Java Parameter类的具体用法?Java Parameter怎么用?Java Parameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Parameter类属于com.amazonaws.services.cloudformation.model包,在下文中一共展示了Parameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCentOS

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testCentOS() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("CentOS")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java

示例2: testRHEL

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testRHEL() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("RHEL")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java

示例3: testSUSELinuxEnterpriseServer

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testSUSELinuxEnterpriseServer() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("SUSELinuxEnterpriseServer")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java

示例4: testUbuntu

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testUbuntu() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("Ubuntu")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java

示例5: testAmazonLinux2

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testAmazonLinux2() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("AmazonLinux2")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java

示例6: testDefaultAmazonLinux

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testDefaultAmazonLinux() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId())
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:22,代码来源:TestShowcase.java

示例7: test

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void test() {
    final String vpcStackName = "vpc-2azs-" + this.random8String();
    final String endpointStackName = "vpc-endpoint-dynamodb-" + this.random8String();
    final String classB = "10";
    try {
        this.createStack(vpcStackName,
                "vpc/vpc-2azs.yaml",
                new Parameter().withParameterKey("ClassB").withParameterValue(classB)
        );
        try {
            this.createStack(endpointStackName,
                    "vpc/vpc-endpoint-dynamodb.yaml",
                    new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName)
            );
            // TODO how can we check if this stack works?
        } finally {
            this.deleteStack(endpointStackName);
        }
    } finally {
        this.deleteStack(vpcStackName);
    }
}
 
开发者ID:widdix,项目名称:aws-cf-templates,代码行数:24,代码来源:TestVPCEndpointDynamoDB.java

示例8: test

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void test() {
    final String vpcStackName = "vpc-2azs-" + this.random8String();
    final String natStackName = "vpc-nat-gateway-" + this.random8String();
    final String classB = "10";
    try {
        this.createStack(vpcStackName,
                "vpc/vpc-2azs.yaml",
                new Parameter().withParameterKey("ClassB").withParameterValue(classB)
        );
        try {
            this.createStack(natStackName,
                    "vpc/vpc-nat-gateway.yaml",
                    new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName)
            );
            this.testVPCSubnetInternetAccess(vpcStackName, "SubnetAPrivate");
        } finally {
            this.deleteStack(natStackName);
        }
    } finally {
        this.deleteStack(vpcStackName);
    }
}
 
开发者ID:widdix,项目名称:aws-cf-templates,代码行数:24,代码来源:TestVPCNatGateway.java

示例9: test

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void test() {
    final String stackName = "vpc-4azs-" + this.random8String();
    try {
        this.createStack(stackName,
                "vpc/vpc-4azs.yaml",
                new Parameter().withParameterKey("ClassB").withParameterValue("10")
        );
        this.testVPCSubnetInternetAccess(stackName, "SubnetAPublic");
        this.testVPCSubnetInternetAccess(stackName, "SubnetBPublic");
        this.testVPCSubnetInternetAccess(stackName, "SubnetCPublic");
        this.testVPCSubnetInternetAccess(stackName, "SubnetDPublic");
    } finally {
        this.deleteStack(stackName);
    }
}
 
开发者ID:widdix,项目名称:aws-cf-templates,代码行数:17,代码来源:TestVPC4AZs.java

示例10: test

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void test() {
    final String vpcStackName = "vpc-2azs-" + this.random8String();
    final String endpointStackName = "vpc-endpoint-s3-" + this.random8String();
    final String classB = "10";
    try {
        this.createStack(vpcStackName,
                "vpc/vpc-2azs.yaml",
                new Parameter().withParameterKey("ClassB").withParameterValue(classB)
        );
        try {
            this.createStack(endpointStackName,
                    "vpc/vpc-endpoint-s3.yaml",
                    new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName)
            );
            // TODO how can we check if this stack works?
        } finally {
            this.deleteStack(endpointStackName);
        }
    } finally {
        this.deleteStack(vpcStackName);
    }
}
 
开发者ID:widdix,项目名称:aws-cf-templates,代码行数:24,代码来源:TestVPCEndpointS3.java

示例11: invoke

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Override
public void invoke(FacadeFactory factory, ProjectAndEnv projectAndEnv, Collection<Parameter> cfnParams,
                   Collection<Parameter> artifacts, String... argument) throws IOException, InterruptedException,
        CfnAssistException, MissingArgumentException {
    AwsFacade facade = factory.createFacade();

    String filename;
    if (argument==null) {
        String home = System.getenv("HOME");
        String keypairName = format("%s_%s", projectAndEnv.getProject(), projectAndEnv.getEnv());
        filename = format("%s/.ssh/%s.pem", home, keypairName);
    } else {
        filename = argument[0];
    }

    KeyPair keyPair = facade.createKeyPair(projectAndEnv, factory.getSavesFile(), filename);
    System.out.println(format("Created key %s with fingerprint %s", keyPair.getKeyName(),
            keyPair.getKeyFingerprint()));
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:20,代码来源:CreateKeyPairAction.java

示例12: createRequiredParameters

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
public Collection<Parameter> createRequiredParameters(ProjectAndEnv projAndEnv,
                                                         Collection<Parameter> userParameters,
                                                         List<TemplateParameter> declaredParameters,
                                                         ProvidesZones providesZones)
		throws InvalidStackParameterException,
		IOException, CannotFindVpcException {
	
	Collection<Parameter> result  = new LinkedList<>();
	result.addAll(userParameters);
	
	checkNoClashWithBuiltInParameters(result);
	for(PopulatesParameters populator : populators) {
		populator.addParameters(result, declaredParameters, projAndEnv, providesZones);
	}
	
	logAllParameters(result, declaredParameters);
	return result;
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:19,代码来源:ParameterFactory.java

示例13: fetchAutopopulateParametersFor

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
private List<Parameter> fetchAutopopulateParametersFor(ProjectAndEnv projectAndEnv, List<TemplateParameter> declaredParameters, Map<String, AvailabilityZone> zones) throws IOException, InvalidStackParameterException, CannotFindVpcException {
	logger.info(String.format("Discover and populate parameters for %s and %s", templateFile.getAbsolutePath(), projectAndEnv));
	List<Parameter> matches = new LinkedList<>();
	for(TemplateParameter templateParam : declaredParameters) {
		String name = templateParam.getParameterKey();
		if (isBuiltInParamater(name))
		{
			continue;
		}
		logger.info("Checking if parameter should be auto-populated from an existing resource, param name is " + name);
		String description = templateParam.getDescription();
		if (shouldPopulateFor(description)) {
			populateParameter(projectAndEnv, matches, name, description, declaredParameters, zones);
		}
	}
	return matches;
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:18,代码来源:AutoDiscoverParams.java

示例14: populateParamForZone

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
private void populateParamForZone(Collection<Parameter> results,
								  List<TemplateParameter> declaredParameters,
								  Map<String, AvailabilityZone> zones, String parameterName,
								  String parameterDescription) {
	logger.info(String.format("Check parameter for zone %s and target %s", parameterName, parameterDescription));
	String target = parameterDescription.replaceFirst(PopulatesParameters.CFN_TAG_ZONE, "").toLowerCase();
	logger.debug("Check for zone " + target);
	if (zones.containsKey(target)) {
		String zoneName = zones.get(target).getZoneName();
		declaredParameters.stream().filter(declaredParameter -> declaredParameter.getParameterKey().equals(parameterName)).
				forEach(declaredParameter -> {
					addParameterTo(results, declaredParameters, parameterName, zoneName);
					logger.info(String.format("Adding zone parameter %s with value %s", parameterName, zoneName));
				});
	} else {
		logger.error("Could not find matching zone for target " + target);
	}
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:19,代码来源:AutoDiscoverParams.java

示例15: addParameterTo

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
protected void addParameterTo(Collection<Parameter> parameters, List<TemplateParameter> declared, String parameterName, String parameterValue) {
	boolean isDeclared = false;
	for(TemplateParameter declaration : declared) {
		isDeclared = (declaration.getParameterKey().equals(parameterName));
		if (isDeclared==true) break;
	}
	if (!isDeclared) {
		logger.info(String.format("Not populating parameter %s as it is not declared in the json file", parameterName));
	} else {
		logger.info(String.format("Setting %s parameter to %s", parameterName, parameterValue));
		Parameter parameter = new Parameter();
		parameter.setParameterKey(parameterName);
		parameter.setParameterValue(parameterValue);
		parameters.add(parameter);
	}
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:17,代码来源:PopulatesParameters.java


注:本文中的com.amazonaws.services.cloudformation.model.Parameter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。